wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Java Heap Space 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 » Products » Tomcat
Bookmark "Java Heap Space" Watch "Java Heap Space" New topic
Author

Java Heap Space

Eugene Abarquez
Ranch Hand

Joined: May 18, 2006
Posts: 211
Hello All,

I am using Eclipse 3.1.2 running on JBoss. I am getting a Java Heap Space error (Java.lang.OutOfMemoryException), when I am deploying the WAR file of my application. This was not happening before I added some new EAR files for my application. Probably the EAR files were consuming a lot of my memory space. I have heard of something like increasing the heap space to prevent this kind of problem, but I don't know how to do this in Eclipse.

Does anybody out there know how to avoid this kind of problem?

Thanks in advance. ;)


There's so much to learn in this industry, and not everybody has the necessary interest.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9947
    
161

I am using Eclipse 3.1.2 running on JBoss



You will have to change the run.bat file of JBoss present in %JBOSS_HOME%/bin/run.bat

Add the following to it:



[My Blog] [JavaRanch Journal]
Eugene Abarquez
Ranch Hand

Joined: May 18, 2006
Posts: 211
Yes, it is working fine now.

I just added the following lines in my run.bat file from jboss-4.0.3SP1\bin:

set JAVA_OPTS=%JAVA_OPTS% -Xms512m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m

Thanks!
Eugene Abarquez
Ranch Hand

Joined: May 18, 2006
Posts: 211
Hi jaikiran pai,

As a follow-up question to my post: What is the maximum heap size that you can set to the JVM? And how do you know the appropriate size to set?

Thanks.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9947
    
161

This might answer your question:

Maximum Heap Size
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Heap Space
 
Similar Threads
Java heap space
How to read memory usage for process running in Linux,
Java Heap Space Error
Possible to change heap size while java is running on a Solaris box?
eclipse - server tomcat - dies after 7-8 restarts (Java heap space)