|Re: Memory Leak [message #444426 is a reply to message #444233]
||Tue, 12 October 2004 15:43
| Steve Northover
Registered: July 2009
OutOfMemoryError is never causes by leaking operating system resources.|
Rather, it is caused by "leaking" Java objects. How is this possible when
Java is a garbage collected language? A Java object is "leaked" when an
application unintentionally keeps a reference to an object (say in a static
variable) and the garbage collector can't do its job. When an SWT object is
disposed, not only are operating system resources released but interal
object references are set to null so that, even if an application were to
hold into an SWT object and defeat the garbage collector, the objects inside
can be released. It's the best we can do.
"Ryan" <firstname.lastname@example.org> wrote in message news:email@example.com...
> In my application, after I do a bunch of operations, I get a Java
> OutOfMemoryError. Is it likely that this error is happening because I am
> not disposing my SWT objects (i.e. widgets, images, etc.)?
> I thought that SWT objects predominantly use native memory. If this is
> true, then failing to dispose SWT objects would probably not be the cause
> of an OutOfMemoryError. Is this correct?
Powered by FUDForum
. Page generated in 0.01739 seconds