Skip to main content

[JAVA2D] Still Memory Leak with Image

1 reply [Last post]
Anonymous

Hi,

I 'm working on a graphical zoomable application that draws a lot of handled
graphical objects. For optimization purpose, I replace graphical objects by
images when zooming far out. When I dispose and dereference these images the
memory is never disposed.

I have tested my application on 1.4 and 1.5 and I have tried the
Image.flush() method, but it still doesn't work. This bug is stated as
closed in 1.5, but I think it is still present.

If there is a workaround that really works, I would be glad to know it.

Thanks.

J�r�me
Institut National de l'Audiovisuel
France

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".
[att1.html]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Dmitri Trembovetski

Hello,

On Thu, Jul 08, 2004 at 12:02:24PM +0200, J?r?me Thi?vre wrote:
> Hi,
>
> I 'm working on a graphical zoomable application that draws a lot of handled
> graphical objects. For optimization purpose, I replace graphical objects by
> images when zooming far out. When I dispose and dereference these images the
> memory is never disposed.

How can you tell this? Did you use a profiler? If so, it should also
provide you with the information on the objects holding references to
your images and preventing them from being collected.

You can use the built-in profiler ('java -Xrunhprof:help' in 1.4.x,
'java -agentlib:hprof=help' in 1.5).

Can you come up with a test case?

Thank you,
Dmitri

>
> I have tested my application on 1.4 and 1.5 and I have tried the
> Image.flush() method, but it still doesn't work. This bug is stated as
> closed in 1.5, but I think it is still present.
>
> If there is a workaround that really works, I would be glad to know it.
>
> Thanks.
>
> J?r?me
> Institut National de l'Audiovisuel
> France
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the body
> of the message "signoff JAVA2D-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".