Desktop productivity for business analysts and programmers

How do I fix "ERROR: Java virtual machine exception. java.lang.OutOfMemoryError: Java heap space."

Reply
New Contributor
Posts: 2

How do I fix "ERROR: Java virtual machine exception. java.lang.OutOfMemoryError: Java heap space."

 

Hello, 

 

I am trying to build a predictive logistic regression model in SAS Enterprise Guide by using the following code: 

 

proc logistic data=loe_pred_int_train desc plots(only)=(roc(id=obs) effect);
class &classvars ;
model engage = &varlist &int_top100 / selection=forward slentry=0.05 ;
score data=loe_pred_int_val out= sco_validate_int(rename=(p_1=p_forward_05)) ;
run ;

 

The original dataset that I am using contains over 13,000 rows and the macro's &varlist and &int_top100 contain over 400 variables together. I then did a 60/40 split from this original dataset into loe_pred_int_train and loe_pred_int_val, respectively. When I try to run the above code, I receive the following error: 

 

ERROR: Java virtual machine exception. java.lang.OutOfMemoryError: GC overhead limit exceeded.

 

After googling this error, I have learned that this error has occurred because my Java Virtual Machine does not have a large enough memory to process the statement. It is recommended that I increase the JRE parameters -Xms and -Xmx in the SAS 9 config file (SASV9.CFG) to resolve this issue. Here is a link to where I found this solution: http://support.sas.com/kb/31/184.html

 

My question is if anyone knows how to resolve this issue WITHOUT having to change the JRE parameters? Is there an option that I can add to my code to temporarily expand my VM memory so that the statement can be executed? Additionally, SAS still produces an output from the code despite this error. Is this output valid? 

 

Any sort of information would be very helpful. Thanks!

Community Manager
Posts: 2,691

Re: How do I fix "ERROR: Java virtual machine exception. java.lang.OutOfMemoryError: Java heap

I'm guessing that the Java error results from the "plots" part of the code.  If you left off the plots, it will probably run without error.

 

But you probably want the plots, which is why you have them in the program.  Maybe the ROC plot will result in more plot points than a typical analysis and that causes the exception.  Consider leaving off the plot for now, and perhaps experiment with different plots on the output data that might be useful.  You don't say what version of SAS you're using -- it's possible that this is something that is fixed in a more recent version.  

 

Chris

Trusted Advisor
Posts: 1,300

Re: How do I fix "ERROR: Java virtual machine exception. java.lang.OutOfMemoryError: Java heap

As mentioned in the SAS Usage Note you already shared here, the issue would likely be due to creating the requested plot. All other output is probably reliable, and you could verify that be rerunning the logistic regression with plots=none.

You cannot modify JRE parameters without modifying either the command line for SAS or the config file.

You may be able to still request this plot by modifying your ODS options for the plot, the following link provides a list of options affecting ODS memory usage for graphs.

http://support.sas.com/documentation/cdl/en/grstatgraph/67882/HTML/default/viewer.htm#p1ccq9z22nosew...


P.S. You should not post the same question to multiple community forum areas...

Ask a Question
Discussion stats
  • 2 replies
  • 2280 views
  • 1 like
  • 3 in conversation