Microsoft KB Archive/192384

= BUG: Applet.getImage, getAudioClip Cause Memory/Handle Leak =

Article ID: 192384

Article Last Modified on 8/25/2005

-

APPLIES TO


 * Microsoft Java Virtual Machine
 * Microsoft Software Development Kit for Java 2.02
 * Microsoft Software Development Kit for Java 2.01
 * Microsoft Software Development Kit for Java 2.02
 * Microsoft Software Development Kit for Java 3.0

-



This article was previously published under Q192384



SYMPTOMS
When loading images or audio files from an applet with getImage or getAudioClip, a memory and handle leak will result.



CAUSE
Images and audio clips loaded via Applet.getImage and Applet.getAudioClip are cached in an unbounded hash table. If you have an applet that loaded many images, memory usage will grow with each image loaded.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.



MORE INFORMATION
Memory usage was measured by watching the Working Set and Handle Count of the Iexplore.exe process using the Performance Monitor (Perfmon.exe) in Windows NT. As new images were loaded, the items above continued to increase, even after the java.awt.Image variable was set to null and System.gc was called.

