Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

createImage and OutOfMemory problems

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a component that contains an image.
then, I make repeated calls to component.createImage. After 40 iterations, a test application gets an OutOfMemoryError within the java.awt.image class. How can I prevent the memory from begin eaten up by successive calls to createImage? I have tried image.flush() and Runtime.getRuntime().gc() but it didn't work. Any help would be appreciated.
 
cata lin
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Try to increase the initial and maximum heap of the JVM.
Try java -X on jdk to see more.
Cheers,
cata Lin.
 
Hug your destiny! And hug this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!