Discussion Locked This discussion was was locked by a forum moderator.

Java Out of Memory Error

Running a parametric sweep of a 2d electrostatic model. Sweeping two parameters results in 80 configurations.
The computer this runs on has 12 Gb of ram.
The analysis never goes over 1 Gb for the Working Set or Virtual Memory
Comsol Version 4.0, Windows 7 64 bit.

Near the end of the run, sometimes, get an error message relating to memory. Here is the last bit from the log:

00611:005 ERROR Exception:
java.lang.OutOfMemoryError: GC overhead limit exceeded
(rethrown as com.comsol.util.exceptions.FlException)
Messages:
Error in sweep: GC overhead limit exceeded
[com.comsol.logger]
00611:005 ERROR Stack trace: [com.comsol.logger]
00633:891 ERROR Exception:
java.lang.ArrayIndexOutOfBoundsException
(rethrown as com.comsol.util.exceptions.FlException)
Messages:

[com.comsol.logger]
00633:906 ERROR Stack trace: [com.comsol.logger]


What is going on, and How do I fix this issue?

10 Replies Last Post Sep 7, 2017, 4:51 PM EDT
COMSOL Moderator

Hello Roy Martin

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

Jarlath McEntee
Posted: 7 years ago Jul 14, 2010, 7:34 PM EDT
I am having GC overhead limit issues too.

My machine has huge amounts of RAM.

Is there a particular version of Java we should have installed on a Windows 7 machine?
I am having GC overhead limit issues too. My machine has huge amounts of RAM. Is there a particular version of Java we should have installed on a Windows 7 machine?

Posted: 7 years ago Jul 15, 2010, 6:07 AM EDT
Maybe the maximum java heap size is the problem. I remember 256MB is the default setting for this.

I would try to increase it by editing the MAXHEAP-value in the comsol.opts file, which is located in the comsol bin directory to 512MB or higher ...
Maybe the maximum java heap size is the problem. I remember 256MB is the default setting for this. I would try to increase it by editing the MAXHEAP-value in the comsol.opts file, which is located in the comsol bin directory to 512MB or higher ...

Posted: 7 years ago Jul 17, 2010, 5:04 AM EDT
Hi,

I have a similar problem, but there is no comsol.opt file in the bin directory neither in any comsol directories.

Can someone give me some advice?

Thanks,
Mate
Hi, I have a similar problem, but there is no comsol.opt file in the bin directory neither in any comsol directories. Can someone give me some advice? Thanks, Mate

Posted: 7 years ago Jul 17, 2010, 7:08 AM EDT
"On UNIX, Linux, and the Macintosh, edit the 'comsol' shell script, located in the bin directory under your COMSOL directory."

just read the doc ;)
"On UNIX, Linux, and the Macintosh, edit the 'comsol' shell script, located in the bin directory under your COMSOL directory." just read the doc ;)

Jarlath McEntee
Posted: 7 years ago Jul 17, 2010, 9:44 AM EDT
This option seems to be available for COMSOL 3.5 but not for COMSOL 4.0

There is no comsol.opts file in the bin directory for COMSOL 4

What is the fix for 4.0?
This option seems to be available for COMSOL 3.5 but not for COMSOL 4.0 There is no comsol.opts file in the bin directory for COMSOL 4 What is the fix for 4.0?

Posted: 7 years ago Jul 17, 2010, 10:53 AM EDT
Jarlath is right, there is no comsol.opt file for 4.0 (although there is for 3.4).

I can't access the KB, because I only have students license, but I know there are topics on Java Runtime Errors.
A week ago 4.0 worked fine and since yesterday it keeps crashing right after I start it.

Do you know any solutions?
Jarlath is right, there is no comsol.opt file for 4.0 (although there is for 3.4). I can't access the KB, because I only have students license, but I know there are topics on Java Runtime Errors. A week ago 4.0 worked fine and since yesterday it keeps crashing right after I start it. Do you know any solutions?

Posted: 7 years ago Sep 13, 2010, 6:39 PM EDT
There is no comsol.opt file anymore for version 4.0. However, under \COMSOL40a\bin\win32 or \COMSOL40a\bin\win64 there are the files comsol.ini and comsolserver.ini. The maximum Java heap size is defined as the numeric value after -Xmx. The default is -Xmx1024m or 1024 megabytes.

There are other configuration options here which are specified in \COMSOL40a\java\win64\jre\bin\server\Xusage.txt or \COMSOL40a\java\win32\jre\bin\client\Xusage.txt.
There is no comsol.opt file anymore for version 4.0. However, under \COMSOL40a\bin\win32 or \COMSOL40a\bin\win64 there are the files comsol.ini and comsolserver.ini. The maximum Java heap size is defined as the numeric value after -Xmx. The default is -Xmx1024m or 1024 megabytes. There are other configuration options here which are specified in \COMSOL40a\java\win64\jre\bin\server\Xusage.txt or \COMSOL40a\java\win32\jre\bin\client\Xusage.txt.

Posted: 3 years ago Mar 26, 2014, 5:27 AM EDT
Hello everybody
Has anyone solved this problem with memory and JAVA?

I have the same problem and I'm using v4.4

Hello everybody Has anyone solved this problem with memory and JAVA? I have the same problem and I'm using v4.4

Posted: 2 weeks ago Sep 7, 2017, 12:36 PM EDT
You may take a look at this post:

"Error: Java heap space. LiveLink for MATLAB." at

www.comsol.com/support/knowledgebase/1092/

Thank you.
You may take a look at this post: "Error: Java heap space. LiveLink for MATLAB." at https://www.comsol.com/support/knowledgebase/1092/ Thank you.

Walter Frei COMSOL Employee
Posted: 2 weeks ago Sep 7, 2017, 4:51 PM EDT
Updated: 2 weeks ago Sep 7, 2017, 4:51 PM EDT
Hello All,

Samuel's response here is appropriate, and we would also suggest the following article:
www.comsol.com/support/knowledgebase/830/

The original error message reported in this thread (which was for version 4.0, and from over seven years ago) should now be resolved, so we will close this thread for further comments. Of course if anyone encounters similar issues, and if the above knowledgebase article does not resolve them, please do not hesitate to contact us.

Best Regards,
Hello All, Samuel's response here is appropriate, and we would also suggest the following article: https://www.comsol.com/support/knowledgebase/830/ The original error message reported in this thread (which was for version 4.0, and from over seven years ago) should now be resolved, so we will close this thread for further comments. Of course if anyone encounters similar issues, and if the above knowledgebase article does not resolve them, please do not hesitate to contact us. Best Regards,

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.