aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 9317
    
109

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: 9317
    
109

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 Error
eclipse - server tomcat - dies after 7-8 restarts (Java heap space)
Java heap space
How to read memory usage for process running in Linux,
Possible to change heap size while java is running on a Solaris box?