• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Regarding JVM options with Heap size and PermGenSpace

 
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As docs say

MaxPermSize specifies the size for a heap that holds objects such as classes and methods.

Are these huge number of classes related to the loaded classes/or which are written as part of Application development??

So what is the difference between a Heap size and PermGenSpace?




Thanks in advance.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

RaviNada Kiran wrote:So what is the difference between a Heap size and PermGenSpace?



You have pretty much described it. The Permanent Generation is where the JVM keeps class descriptions. And yes, these are the classes you have written when you develop an application. I would only increase it's size if you get an OutOfMemoryError indicating that the JVM has run out of PermGen space. The number of classes in an application is not very dynamic, so we don't see this situation very often (the exception being application servers, which get a new influx of class descriptions every time an application is redeployed).
The Heap is where the JVM creates class instances. The heap is far more dynamic than the PermGen and more susceptible to running out of memory.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joe Ess wrote:

RaviNada Kiran wrote:So what is the difference between a Heap size and PermGenSpace?



I would only increase it's size if you get an OutOfMemoryError indicating that the JVM has run out of PermGen space.


Thanks Joe.


so you mean to say that the log files will indicate PermGen space and then i need to increase -XX

why i am asking because if i get OutOfMemoryError i would be only increasing the xms and xmx options only. But i have never done -XX option.
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

RaviNada Kiran wrote:
so you mean to say that the log files will indicate PermGen space and then i need to increase -XX



Correct. Here's one that recently happened to an application I maintain:

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joe Ess wrote:

RaviNada Kiran wrote:

Correct. Here's one that recently happened to an application I maintain:





Hope you solve it early. Thanks a lot for explanation.

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi RaviNada Kiran/Joe Ess,
i am still not clear with the use of these two marameters (heap size and permanent generation space).
Could you put more light on this?

In my appliaction this configuration is getting used
-Xms128m -Xmx1024m -XX:PermSize=64M -XX:MaxPermSize=256M

I am not sure whether we can keep mx greter then MaxPermSize, in my case mx=1024 and MaxPermSize=256?

Thanks in advance.
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Because the size of the permanent generation varies from application to application, there's no way for us to tell you what those settings should be.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
XMS and XMX are parameters for your running application which is dynamic and which depends upon the Threads(Requests) which are accessing your application and often requires Object creations .(so this indicates what should be the initial and final memory allocated to them)

and PermGen space is the space for your classes declarations created as part of your application.

 
Ashok Sharma
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for you reply,
So is memory allocated to MaxPermSize is a part of memory allocated to Xmx?
 
reply
    Bookmark Topic Watch Topic
  • New Topic