This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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


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: 10146
    
165

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: 10146
    
165

This might answer your question:

Maximum Heap Size
 
GeeCON Prague 2014
 
subject: Java Heap Space