> I got:
> Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap
[quoted text clipped - 11 lines]
> the memory.Could you show me the way to see the cause of Exception from
> above.
You will observe this error when the VM fails to allocate memory. You should
note that this is not the same as "out of memory", since a failed memory
allocation is potentially recoverable. For example, suppose your VM has
256MB heap space free, and you perform some operation that results in a
memory allocation attempt of 320MB - this will cause a OutOfMemoryError, but
obviously, the VM has plenty of memory available - just not for that
allocation. Are you performing a huge memory allocation? e.g. creation of a
large array. You may get away with simply assigning more heap space to the
VM with the -Xmx option.
Are you leaking external resources? I have seen quite often where code will
fail to close some file, socket, database connection in a finally block,
resulting in an implicit unwinding of the call stack, and therefore, the
call to close which is typically in the try block never executes. An
obscurity of this scenario is where the developer has indeed closed in a
finally block, but has used a local assignment to null to attempt to
determine if the close is necessary - this is flawed, albeit common.
Are you maintaining unnecessary strong references that continually grow?
See if this helps:
Can Java applications leak memory?
http://jqa.tmorris.net/GetQAndA.action?qids=38&showAnswers=true

Signature
Tony Morris
http://tmorris.net/
Java Questions and Answers
http://jqa.tmorris.net/
Dado - 16 Jan 2006 07:54 GMT
"Tony Morris" <not@telling.you> je napisao u poruci interesnoj
grupi:43cad5e2@quokka.wn.com.au...
>> I got:
>> Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java
[quoted text clipped - 40 lines]
>
> Are you maintaining unnecessary strong references that continually grow?
I setup VM as a follows:
on my Athlon 2300+ with a 512MB.
My application use a HSQLDB database and I don't think so that is something
unclosed from that side.
I suppossed that it is a long arrays which are the points for a 2DGraphics
drawing. But know in a finalizing step, I can't println the size of every
suspicious variable, so I need a IDE help to see the bottlenecks.
p.s.
you didn't comment my
Dado - 16 Jan 2006 07:58 GMT
> p.s.
> you didn't comment my precidation
[quoted text clipped - 4 lines]
> free
> the memory.