Out of memory error

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Moe Curtin
Posts: 43
Joined: Fri Oct 02, 2009 5:40 am

Out of memory error

Post by Moe Curtin » Mon Jun 28, 2010 8:34 am

I sometimes get the following error message when I'm running CMC:

java.lang.OutOfMemoryError: Java heap space

Is there anything I can do to stop this from happening?

Thanks

User avatar
Ayman Habib
Posts: 2233
Joined: Fri Apr 01, 2005 12:24 pm

RE: Out of memory error

Post by Ayman Habib » Mon Jun 28, 2010 9:55 am

Hi Moe,

Due to very fine sampling while running CMC, this can happen. One solution is to increase the heap-size used by the GUI (which I can explain if you're interested), but another possible solution that reduces the memory requirements significantly is to run CMC from the command line (as in cmc -S setup_file.xml).

Please check the user guide for details if you haven't done that before and let us know if you have any questions.

Good luck,
-Ayman

User avatar
Chris Zirker
Posts: 44
Joined: Tue Mar 03, 2009 11:09 am

RE: Out of memory error

Post by Chris Zirker » Mon Jun 28, 2010 11:53 am

I get heap memory errors regularly when using the plot tools (I use it to export data sometimes and make very large plots). I would be very interested to know how to increase the heap size used by the GUI.

User avatar
Ayman Habib
Posts: 2233
Joined: Fri Apr 01, 2005 12:24 pm

RE: Out of memory error

Post by Ayman Habib » Mon Jun 28, 2010 1:15 pm

Hi Chris,

In the file etc/opensim.conf you can modify the command line options given on the line:
default_options="-J-Xms24m -J-Xmx64m ...."

Try changing this line to
default_options="-J-Xms48m -J-Xmx128m ...."

or something similar depending on your machine.

-Ayman

User avatar
Moe Curtin
Posts: 43
Joined: Fri Oct 02, 2009 5:40 am

RE: Out of memory error

Post by Moe Curtin » Wed Jun 30, 2010 8:50 am

Thanks a million Ayman!

User avatar
Stefan Schaffelhofer
Posts: 1
Joined: Thu Mar 29, 2012 4:37 pm

Re: Out of memory error

Post by Stefan Schaffelhofer » Fri Aug 17, 2012 4:38 am

Dear Ayman,

I also get the same "out of memory error" when I run IK with the GUI. Are the changes of the opensim.conf affecting the IK running the GUI or from the command line? Could you tell a bit more about the heap size? What is it's maximum value?
You mentioned fine sampling rates could cause this problem. I'm using a sampling rate of 50 Hz over 4000 seconds (200000 samples). After 7% of processing the simulation I get this error. Is there a limited length of the TRC-file or a critical sampling rate?
I would be greatful to receive an answer.

Thanks -Stefan

POST REPLY