Out of memory in java swing application

Hi,

I am continously getting out of memory in my java application. I collected the java heap dump and found major memory chunk ( >90%) of total java heap is taken by some "class [I", which is array of 'Inetger' objects and sometimes by "class [S", which is array of 'Short' objects.

Elements of these arrays are referred by:

java.awt.image.DataBufferUShort and

sun.awt.image.ShortInterleavedRaster

and these are consuming major memory chunks.

Has anyone observed this kind of problem?

I am not able to proceed in my analysis and kind of struck at these Integer and Short arrays. Please help.

Thanks

Charanjeet

[678 byte] By [jannyguya] at [2007-11-26 17:52:35]
# 1

Sounds like you're retaining a lot of image resources - make sure you're doing the following:

1. flush()*** images once you've used them

2. not retaining references you no longer need

3. not creating duplicate Image objects where not required

4. not creating Image objects which are never needed, or creating a huge pile of images at once when they are not all required at the same time

itchyscratchya at 2007-7-9 5:05:29 > top of Java-index,Desktop,Core GUI APIs...