-1

I'm running some Java code doing some crypto stuff and it gets a java.lang.OutOfMemoryError.

I modified the eclipse.ini from -Xmx1024m to -Xmx2048m.

I opened the task manager and I run the app again and I saw that the JVM is consuming all the 2048 MB of RAM and still the same error. Then I put 3500 MB, but in the task manager the JVM still used only 2048 MB of RAM and still the same error.

What can I do? What other info should I publish to help you help me?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
  • 1
    Try getting the heap dump and check what exactly is consuming the space. Check JMap on how to get heap memory dump. http://docs.oracle.com/javase/7/docs/technotes/tools/share/jmap.html – Keen Sage Jan 17 '15 at 21:38

2 Answers2

3

eclipse.ini increases the memory given to Eclipse not to your program

You need to change the run configuration of your program.

  • In the run menu , select run configuration
  • Select your run configuration
  • Select arguments tab
  • In VM arguments you can add -Xmx2048m
Stéphane
  • 867
  • 4
  • 7
2

I believe the problem is that you're setting the amount of memory that Eclipse uses, but what you really want to do is set the amount of memory that your code uses - these are 2 different things.

See the answer to this question for how to set the memory of your running code

Community
  • 1
  • 1
tddmonkey
  • 20,798
  • 10
  • 58
  • 67