ML_Passion
ML_Passion

Reputation: 1081

Java heap Error while running R code

I'm trying to do a feature selection using the chi.squared function in FSelector package in R.

My dataset is about 132 variables X 192,000 rows.

chisquared.fs <- chi.squared(fo,df)

where fo contains the class variable: class ~.

I'm getting this error while running the code:

Error in .jcall("weka/filters/Filter", "Lweka/core/Instances;", "useFilter",
:java.lang.OutOfMemoryError: Java heap space

I know it is a Java memory leak error and I have already tried this before calling any libraries:

options( java.parameters = "-Xmx6g")

Any pointers would be really welcome.

Upvotes: 2

Views: 1411

Answers (1)

ML_Passion
ML_Passion

Reputation: 1081

Guys update: I had done what @copeg suggested without restarting R. I restarted R and with the options statement at the beginning before calling the libraries and it worked. Thanks for your suggestions.

Upvotes: 2

Related Questions