Fixing heap out of memory exception for features model