Thread Subject: Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space

Subject: Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space

From: Nasser Abbasi

Date: 23 Jul, 2008 05:19:50

Message: 1 of 4

2007a, student version on windoz XP SP2.

I use GUIDE, and after sometime of using it, I notice it gets sluggish in
its response to editing and I see the following Java errors on the console:

"Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java
heap space"

I am not sure why it runs out of RAM so fast. as I have 4 GB of physical
RAM.

I did a google on the above and I see that others have seen this.

I wonder if there is any update on this problem that someone from Mathworks
or others can comment on.

Is this still a problem in later Matlab releases?

thanks,
Nasser


Subject: Exception in thread

From: Stefan

Date: 30 Jul, 2008 08:34:03

Message: 2 of 4

Dear Nasser,

I'm dealing with the same problems. And it seems, that noone
really knows something about the java heap memory. I never
got a clear response on this topic.

I found a small workaround to free some heap memory.

heapTotalMemory = java.lang.Runtime.getRuntime.totalMemory;
heapFreeMemory = java.lang.Runtime.getRuntime.freeMemory;
if(heapFreeMemory < (heapTotalMemory*0.01))
    java.lang.Runtime.getRuntime.gc;
end

I'm calling the java garbace collector if the free memory
drops below a certain limit.

Maybe this helps.
Keep me up to date if you get any news according to the java
heap memory.

Best regards,
  Stefan.

"Nasser Abbasi" <nma@12000.org> wrote in message
<Zbzhk.16026$mh5.2132@nlpi067.nbdc.sbc.com>...
> 2007a, student version on windoz XP SP2.
>
> I use GUIDE, and after sometime of using it, I notice it
gets sluggish in
> its response to editing and I see the following Java
errors on the console:
>
> "Exception in thread "AWT-EventQueue-0"
java.lang.OutOfMemoryError: Java
> heap space"
>
> I am not sure why it runs out of RAM so fast. as I have 4
GB of physical
> RAM.
>
> I did a google on the above and I see that others have
seen this.
>
> I wonder if there is any update on this problem that
someone from Mathworks
> or others can comment on.
>
> Is this still a problem in later Matlab releases?
>
> thanks,
> Nasser
>
>

Subject: Exception in thread

From: Juan Luis

Date: 21 Oct, 2008 09:57:01

Message: 3 of 4

I get the same error.

It is disgusting, because now I get this error when I execute a file that was working perfectly some days ago. Unfortunately, I had to format my HD and now I get this strange error.

I am a unexperienced user. How can I get this fixed? Thanks very much...

Subject: Exception in thread

From: Dave Brackett

Date: 21 Oct, 2008 13:32:01

Message: 4 of 4

"Juan Luis " <jlvalera@yahoo.es> wrote in message <gdk91d$b$1@fred.mathworks.com>...
> I get the same error.
>
> It is disgusting, because now I get this error when I execute a file that was working perfectly some days ago. Unfortunately, I had to format my HD and now I get this strange error.
>
> I am a unexperienced user. How can I get this fixed? Thanks very much...

have you tried increasing the maximum allowed heap space as explained in the instructions at this page:
http://www.mathworks.com/support/solutions/data/1-18I2C.html

it sorted my problem when I got this error.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com