Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
|
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 16th, 2009, 09:36 PM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default specify heap and permgen size for jvm

When you start up jvm, you can specify heap size and PermGen size, for example '-Xms512m -Xmx1024m -XX:PermSize=384m -XX:MaxPermSize=512m".

Here is my question, heap consists three parts: young gen, old gen and perm gen so it sounds like, in the above case, max yound + max old + max perm should equal to 1024m. But when I read jstat -gccapacity, it seems like max young + max old = 1024m.

Cannot really find any document specifically answering my question, so any idea?
 
Old June 17th, 2009, 07:50 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yes, heap is young+old, PermSize is different. You can find little more info about it at the bellow given links
http://www.freshblurbs.com/explainin...-permgen-space
http://work.tinou.com/2009/04/java-c...ject-size.html

and a tool to check memory usage
http://java.sun.com/developer/techni.../jconsole.html

Hope it gives information you need.
__________________
- Rakesh
http://iam-rakesh.blogspot.com
 
Old June 17th, 2009, 08:28 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

I found some description about it at one url. Might help you understand about PermGen space

What is PermGen space anyways? The memory in the Virtual Machine is divided into a number of regions. One of these regions is PermGen. It’s an area of memory that is used to (among other things) load class files. The size of this memory region is fixed, i.e. it does not change when the VM is running. You can specify the size of this region with a commandline switch: -XX:MaxPermSize. The default is 64 Mb on the Sun VMs.
If there’s a problem with garbage collecting classes and if you keep loading new classes, the VM will run out of space in that memory region, even if there’s plenty of memory available on the heap. Setting the -Xmx parameter will not help: this parameter only specifies the size of the total heap and does not affect the size of the PermGen region.
__________________
- Rakesh
http://iam-rakesh.blogspot.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
lvalue/rvalue vs. stack/heap hkyoon BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 4 January 11th, 2009 11:17 PM
Heap of typing errors HELP!!! ours All Other Wrox Books 11 December 24th, 2007 11:23 AM
Heap Monitor pallavi11 VB How-To 5 January 11th, 2007 08:37 PM
Could not reserve enough space for object Heap overcit Apache Tomcat 0 February 23rd, 2006 12:11 PM
parameters to jvm uskiranj Servlets 0 May 28th, 2004 03:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.