aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes java.lang.OutOfMemoryError: Java heap space Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "java.lang.OutOfMemoryError: Java heap space" Watch "java.lang.OutOfMemoryError: Java heap space" New topic
Author

java.lang.OutOfMemoryError: Java heap space

J Vazquez
Greenhorn

Joined: Aug 24, 2008
Posts: 6
I am using the following code to get ImageIcons from files on my computer to display on jbuttons. After about 4(80x60) images are displayed on my JPanel, I get this error

java.lang.OutOfMemoryError: Java heap space




Any Ideas on what can be done? I read about increasing the memory via the commandline, if this is the case, how do I incorporate that into my program if I plan on distributing it to friends? Thanks
-Juan
Steven Wall
Greenhorn

Joined: Nov 04, 2007
Posts: 22
If you are distributing your application via Java WebStart, in your JNLP file, there is a <j2se> node that is child node of <resources>. On the <j2se> node, there is an attribute for "max-heap-size". You can set the client heap size there.

For example:


SCJP, SCWCD
J Vazquez
Greenhorn

Joined: Aug 24, 2008
Posts: 6
Does anyone see an error in this.. I am running this on os 10.5 if that matters.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.OutOfMemoryError: Java heap space
 
Similar Threads
Dealing with images
JButton slow response time
BufferedImage OutOfMemoryError
how to load compressed tiff image formats with JIMI
very simple question...