Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Heap Space

 
Eugene Abarquez
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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. ;)
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

 
Eugene Abarquez
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might answer your question:

Maximum Heap Size
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic