Path: news.mathworks.com!not-for-mail
From: "Stefan " <jo@sicha.ned>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Exception in thread
Date: Wed, 30 Jul 2008 08:34:03 +0000 (UTC)
Organization: TU Wien
Lines: 55
Message-ID: <g6p91r$fvb$1@fred.mathworks.com>
References: <Zbzhk.16026$mh5.2132@nlpi067.nbdc.sbc.com>
Reply-To: "Stefan " <jo@sicha.ned>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1217406843 16363 172.30.248.38 (30 Jul 2008 08:34:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 30 Jul 2008 08:34:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 546391
Xref: news.mathworks.com comp.soft-sys.matlab:482576



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
> 
>