Two Laptop Bag*
The moose likes Performance and the fly likes OutOfMemoryError in java swing application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "OutOfMemoryError in java swing application" Watch "OutOfMemoryError in java swing application" New topic
Author

OutOfMemoryError in java swing application

Kuppuraj Govindhasamy
Greenhorn

Joined: Feb 23, 2007
Posts: 4
Hi,
I am getting OutOfMemoryError in my java swing application as below.
Exception occurred during event dispatching:
java.lang.OutOfMemoryError
at sun.awt.image.Image.<init>(Compiled Code)
at sun.awt.windows.WImage.<init>(Compiled Code)
at sun.awt.windows.WOffScreenImage.<init>(Compiled Code)
at sun.awt.windows.WComponentPeer.createImage(Compiled Code)
at java.awt.Component.createImage(Compiled Code)
at java.awt.Component.createImage(Compiled Code)
at java.awt.Component.createImage(Compiled Code)
at java.awt.Component.createImage(Compiled Code)
at java.awt.Component.createImage(Compiled Code)
at java.awt.Component.createImage(Compiled Code)
at java.awt.Component.createImage(Compiled Code)
at java.awt.Component.createImage(Compiled Code)
at java.awt.Component.createImage(Compiled Code)
at itm.map.MapView.paint(Compiled Code)
at javax.swing.JComponent.paintChildren(Compiled Code)
at javax.swing.JComponent.paint(Compiled Code)
at javax.swing.JComponent.paintChildren(Compiled Code)
at javax.swing.JSplitPane.paintChildren(Compiled Code)
at javax.swing.JComponent.paint(Compiled Code)
at javax.swing.JComponent.paintChildren(Compiled Code)
at javax.swing.JSplitPane.paintChildren(Compiled Code)
at javax.swing.JComponent.paint(Compiled Code)
at javax.swing.JComponent.paintChildren(Compiled Code)
at javax.swing.JComponent.paint(Compiled Code)
at javax.swing.JComponent.paintChildren(Compiled Code)
at javax.swing.JComponent.paint(Compiled Code)
at javax.swing.JComponent.paintChildren(Compiled Code)
at javax.swing.JComponent.paint(Compiled Code)
at javax.swing.JLayeredPane.paint(Compiled Code)
at javax.swing.JComponent.paintChildren(Compiled Code)
at javax.swing.JComponent.paint(Compiled Code)
at java.awt.Container.paint(Compiled Code)
at itm.map.ItmMap.update(Compiled Code)
at sun.awt.windows.WComponentPeer.handleEvent(Compiled Code)
at java.awt.Component.dispatchEventImpl(Compiled Code)
at java.awt.Container.dispatchEventImpl(Compiled Code)
at java.awt.Window.dispatchEventImpl(Compiled Code)
at java.awt.Component.dispatchEvent(Compiled Code)
at java.awt.EventDispatchThread.run(Compiled Code)

Is it possible to fix this?
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Where is the class itm.map.MapView coming from? What is the code supposed to do?

Have you tried reserving more heap space?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Kuppuraj Govindhasamy
Greenhorn

Joined: Feb 23, 2007
Posts: 4
I am starting my application using below command(you the heap size given there).
jre -noclassgc -classpath %CLASSPATH% -mx256m -ms99m -Dnmsfmint.remote=true -Dnmsfmint.fmname=%FMNAME% %D_PARAMS% %nmxclient% itm.map.ItmRun gt=%tracelevel% lang=english log=%logfile% nmHelp=%juidrive%%juiroot%\jnm\itm\help\appl\lang\english xmHelp=%juidrive%%juiroot%\jnm\itm\xm\help\appl\lang\english tr=true tc=%TRUE_COLOR% fm=NONE

MapView class is drawing some icons on the Painting area.
Kuppuraj Govindhasamy
Greenhorn

Joined: Feb 23, 2007
Posts: 4
sorry for missing words. you can the see the heap size in the jre command.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
It is very easy to create memory "leaks" in Swing if you don't properly dispose of listeners. The swing forum is where you will get help on this.

Bill
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: OutOfMemoryError in java swing application
 
Similar Threads
file reading in applet
Java Fault?
Set my Java application as the default program to open a file extension
JTable woes
How do I implement my own table model (using JTable)?