• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

OutOfMemoryError in java swing application

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where is the class itm.map.MapView coming from? What is the code supposed to do?

Have you tried reserving more heap space?
 
Kuppuraj Govindhasamy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry for missing words. you can the see the heap size in the jre command.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic