Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Caused by: java.lang.OutOfMemoryError: PermGen space ......what kind of error is this?

 
Vinod Vinu
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,, sometimes i get the following error on cosole of eclipse and evry time i need to restart tomcat server :-

Caused by: java.lang.OutOfMemoryError: PermGen space

what is this error and how to resolve this ?

thanks in advance
 
Baiju Scariah
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As the error says, your system (or memory allocated to jvm) is running out of memory.

You may allocate more memory using when you run java program "-Xms512m -Xmx1024m", if there are more memory in your system

Please note that, you may change minimum and maximum memory to 1024 and 2048, if there is more than 2 GB memory
 
Maneesh Godbole
Saloon Keeper
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eclipse questions are more suited in the IDE forum
CarefullyChooseOneForum

Moving.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your are running out of permgen space, so setting -Xmx and -Xms will not help. You will need to set -XX:MaxPermSize=128M (or other suitable size)
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter Johnson wrote:Your are running out of permgen space, so setting -Xmx and -Xms will not help. You will need to set -XX:MaxPermSize=128M (or other suitable size)


True, set -XX:MaxPermSize=256M as a first statement in catalina.bat
 
Vinod Vinu
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
True, set -XX:MaxPermSize=256M as a first statement in catalina.bat



can please tell me where exactly this catalina.bat would be available ?

thank you
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bin directory of tomcat
 
Vinod Vinu
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
True, set -XX:MaxPermSize=256M as a first statement in catalina.bat


Thanks buddy i have got catalina.bat.
now please tell me one more thing that how much size can be given ?

like for e.g. - iam running 3GB of RAM. So can i provide 1024MB of that ?
does allocating more amount of memory would results in something bad or good ?

thank you
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you need 1G of PermGen space something is horribly, horribly wrong. The default (I think) is 64M; as suggested try 128M, or possibly 256M (that seems high to me, but you never know).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic