> How do I increase the default heap size of eclipse or JVM for all the projects?
you can specify default option in the java control panel, but probably not the best idea
Main Topics
Browse All TopicsI am getting a memory error while building an IP model with Eclipse. I am calling CPLEX solver.
The exception that I get is
Exception in thread "main" java.lang.OutOfMemoryError
at ilog.cplex.CpxQExpr.<init>
at ilog.cplex.CpxQextractor.v
at ilog.cplex.CpxNegative.acc
at ilog.cplex.CpxQextractor.v
at ilog.cplex.CpxLinkedExpr.a
at ilog.cplex.CpxRange.<init>
at ilog.cplex.IloCplexModeler
at ilog.cplex.IloCplexModeler
at model.BalanceHindsightTime
at model.BalanceHindsightTime
at test.DBTest.main(DBTest.ja
The line that I am getting the exception is in the code. This constraint is added successfully for almost half of the model, then it gives this error. When I run the model for shorter time horizon(i.e., smaller model) it works.
I tried increasing the JVM memory to 768MB that eclipse is using via eclipse.ini file. It didn't work. I found in many websites that JVM memory can be altered for a class with running
java -jar myJar.jar -Xmx768M. I tried running myJar.jar this way via command prompt, it gave some other error related to CPLEX.
So, my question is:
How do I increase the default heap size of eclipse or JVM for all the projects?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I put -Xmx1024m in the VM arguments specifically for that run. It didn't give that error. Run successfully completed. Thanks, objects.
But, I still need a way to alter the setting that is not specific to a run.
Couldn't find this in JAVA control panel?
"you can specify default option in the java control panel, but probably not the best idea"
Business Accounts
Answer for Membership
by: objectsPosted on 2009-09-10 at 15:03:27ID: 25304992
you need to increase the memory available too your application
in eclipse you can specify the option in the vm options of the run configuration