You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by abhishek jain <ab...@gmail.com> on 2011/04/04 10:09:06 UTC

Re: Max value of MaxPermSize

hi,
I think the following line in
/usr/local/jakarta/apache-tomcat-5.5.28/bin/catalina.sh

if [ -r "$CATALINA_HOME"/bin/tomcat-juli.jar ]; then
  JAVA_OPTS="$JAVA_OPTS -server -Xms512m -Xmx512m -XX:MaxPermSize=1024m
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"

LOGGING_CONFIG="-Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties"
else
  # Bugzilla 45585
  LOGGING_CONFIG="-Dnop"
fi



is  not making any differnece onthe memory consumed,as if i do

# free -m
             total       used       free     shared    buffers     cached
Mem:          3072        696       2375          0          0          0
-/+ buffers/cache:        696       2375
Swap:            0          0          0


the used space is 696 mb, where as , it should allocate more than that to
java itself,

pl. advice how can i allocate more memory to java , as i am getting
permgenerrorof memory (OutOfMemoryError: PermGen space)

thanks
abhi

On Mon, Mar 21, 2011 at 8:03 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Abhishek,
>
> On 3/21/2011 6:14 AM, abhishek jain wrote:
> >>> also am i writing these values in the correct location,
> >>
> >> With the tomcat base startup scripts, this should be in
> >> $CATALINA_BASE/setenv.sh. This file will be sourced by catalina.sh if
> >> it exists.
> >>
> > I have a feeling that i am writing in wrong place, setenv.sh dont
> > exist in my system, do i need to create that
>
> Yes, you can create it. It's better to create this file because it won't
> be overwritten by any Tomcat upgrades you might perform in the future.
>
> > or can i write directly in catalina.sh, if yes where to place this
> > configuration.
>
> You *can* put this into catalina.sh, but it would be better not to.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk2HYboACgkQ9CaO5/Lv0PBPLwCgkNB2NMLGWsIHanH7emroXs2C
> u88An2jZaM3mwkzRvQMTx7Eu0bCFeCDi
> =xNcw
> -----END PGP SIGNATURE-----
>
>

RE: Max value of MaxPermSize

Posted by Jeffrey Janner <Je...@PolyDyne.com>.
> -----Original Message-----
> From: Mark Thomas [mailto:markt@apache.org]
> Sent: Monday, April 04, 2011 9:43 AM
> To: Tomcat Users List
> Subject: Re: Max value of MaxPermSize
> 
> On 04/04/2011 15:40, Jeffrey Janner wrote:
> > Some of the answer below may be off.  I was reading an IBM doc that
> "quoted" a sun doc that said permgen is part of heap.
> > Jconsole lists it as non-heap.
> 
> Process heap != Java object heap
> 
> When you see heap in in any JVM related context you need to be sure
> which it is referring to. It isn't always clear.
> 
> Mark

Yea, my mis-read.  Guess my brain hasn't fully recovered from the thrashing it took trying to restore one of my root drivesv last week.
	
__________________________________________________________________________

Confidentiality Notice:  This Transmission (including any attachments) may contain information that is privileged, confidential, and exempt from disclosure under applicable law.  If the reader of this message is not the intended recipient you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited.  

If you have received this transmission in error, please immediately reply to the sender or telephone (512) 343-9100 and delete this transmission from your system.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Max value of MaxPermSize

Posted by Mark Thomas <ma...@apache.org>.
On 04/04/2011 15:40, Jeffrey Janner wrote:
> Some of the answer below may be off.  I was reading an IBM doc that "quoted" a sun doc that said permgen is part of heap.
> Jconsole lists it as non-heap.

Process heap != Java object heap

When you see heap in in any JVM related context you need to be sure
which it is referring to. It isn't always clear.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Max value of MaxPermSize

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Jeffrey Janner [mailto:Jeffrey.Janner@PolyDyne.com] 
> Subject: RE: Max value of MaxPermSize

> I was reading an IBM doc that "quoted" a sun doc that said 
> permgen is part of heap.

Which does not mean that it's included in the -Xmx settting, just that all the heap components are ... heaps.

> Also check that you have enough user-space memory left to 
> allocate an entire GB to Tomcat.

The OP stated the VM had 3.5 GB, but has failed to indicate whether or not he's using a 32- or 64-bit JVM.  If it's only 32-bit, he's not going to get far enough to use much of the 3.5 GB.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Max value of MaxPermSize

Posted by Jeffrey Janner <Je...@PolyDyne.com>.
Some of the answer below may be off.  I was reading an IBM doc that "quoted" a sun doc that said permgen is part of heap.
Jconsole lists it as non-heap.
Also check that you have enough user-space memory left to allocate an entire GB to Tomcat.

> -----Original Message-----
> From: Jeffrey Janner [mailto:Jeffrey.Janner@PolyDyne.com]
> Sent: Monday, April 04, 2011 9:30 AM
> To: 'Tomcat Users List'
> Subject: RE: Max value of MaxPermSize
> 
> The permgen is actually a section of the heap.
> So if you want a 1GB permgen, you'll need at least a 1GB heap size, but
> you better make it much bigger than that, since you'll need more room
> for all the little things, like variable, objects, etc.
> If you really need that large of a permgen, then you should probably
> take a good look at your app to figure out why.
> 
> (Actually, you probably need only a little more than the default 128Mb
> of PermGen, but your heap doesn't have enough room to expand it.  Try
> changing you settings below to -Xmx768m -XX:MaxPermSize:256m, and see
> if that helps.)
> 
> > -----Original Message-----
> > From: abhishek jain [mailto:abhishek.netjain@gmail.com]
> > Sent: Monday, April 04, 2011 3:09 AM
> > To: Tomcat Users List
> > Cc: Christopher Schultz
> > Subject: Re: Max value of MaxPermSize
> >
> > hi,
> > I think the following line in
> > /usr/local/jakarta/apache-tomcat-5.5.28/bin/catalina.sh
> >
> > if [ -r "$CATALINA_HOME"/bin/tomcat-juli.jar ]; then
> >   JAVA_OPTS="$JAVA_OPTS -server -Xms512m -Xmx512m -
> XX:MaxPermSize=1024m
> > -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
> >
> > LOGGING_CONFIG="-
> >
> Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties"
> > else
> >   # Bugzilla 45585
> >   LOGGING_CONFIG="-Dnop"
> > fi
> >
> >
> >
> > is  not making any differnece onthe memory consumed,as if i do
> >
> > # free -m
> >              total       used       free     shared    buffers
> > cached
> > Mem:          3072        696       2375          0          0
> > 0
> > -/+ buffers/cache:        696       2375
> > Swap:            0          0          0
> >
> >
> > the used space is 696 mb, where as , it should allocate more than
> that
> > to
> > java itself,
> >
> > pl. advice how can i allocate more memory to java , as i am getting
> > permgenerrorof memory (OutOfMemoryError: PermGen space)
> >
> > thanks
> > abhi
> >
> > On Mon, Mar 21, 2011 at 8:03 PM, Christopher Schultz <
> > chris@christopherschultz.net> wrote:
> >
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > >
> > > Abhishek,
> > >
> > > On 3/21/2011 6:14 AM, abhishek jain wrote:
> > > >>> also am i writing these values in the correct location,
> > > >>
> > > >> With the tomcat base startup scripts, this should be in
> > > >> $CATALINA_BASE/setenv.sh. This file will be sourced by
> catalina.sh
> > if
> > > >> it exists.
> > > >>
> > > > I have a feeling that i am writing in wrong place, setenv.sh dont
> > > > exist in my system, do i need to create that
> > >
> > > Yes, you can create it. It's better to create this file because it
> > won't
> > > be overwritten by any Tomcat upgrades you might perform in the
> > future.
> > >
> > > > or can i write directly in catalina.sh, if yes where to place
> this
> > > > configuration.
> > >
> > > You *can* put this into catalina.sh, but it would be better not to.
> > >
> > > - -chris
> > > -----BEGIN PGP SIGNATURE-----
> > > Version: GnuPG v1.4.10 (MingW32)
> > > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> > >
> > > iEYEARECAAYFAk2HYboACgkQ9CaO5/Lv0PBPLwCgkNB2NMLGWsIHanH7emroXs2C
> > > u88An2jZaM3mwkzRvQMTx7Eu0bCFeCDi
> > > =xNcw
> > > -----END PGP SIGNATURE-----
> > >
> > >
> _______________________________________________________________________
> ___
> 
> Confidentiality Notice:  This Transmission (including any attachments)
> may contain information that is privileged, confidential, and exempt
> from disclosure under applicable law.  If the reader of this message is
> not the intended recipient you are hereby notified that any
> dissemination, distribution, or copying of this communication is
> strictly prohibited.
> 
> If you have received this transmission in error, please immediately
> reply to the sender or telephone (512) 343-9100 and delete this
> transmission from your system.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

__________________________________________________________________________

Confidentiality Notice:  This Transmission (including any attachments) may contain information that is privileged, confidential, and exempt from disclosure under applicable law.  If the reader of this message is not the intended recipient you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited.  

If you have received this transmission in error, please immediately reply to the sender or telephone (512) 343-9100 and delete this transmission from your system.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Max value of MaxPermSize

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Jeffrey Janner [mailto:Jeffrey.Janner@PolyDyne.com] 
> Subject: RE: Max value of MaxPermSize

> Do you have any idea why he's having issues?
 
Can't tell - the OP has provided no useful information, and instead of doing some analysis, appears to be taking a shotgun approach to problem solving.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Max value of MaxPermSize

Posted by Jeffrey Janner <Je...@PolyDyne.com>.
Yea, Chuck, I had qualms about the statement, but had found the exact words in a doc.
I sent a retraction while this came in.  Sorry about continuing the confusion.
Do you have any idea why he's having issues?  My bet is he's out of allocatable user-space in his OS vm.

> -----Original Message-----
> From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com]
> Sent: Monday, April 04, 2011 9:38 AM
> To: Tomcat Users List
> Subject: RE: Max value of MaxPermSize
> 
> > From: Jeffrey Janner [mailto:Jeffrey.Janner@PolyDyne.com]
> > Subject: RE: Max value of MaxPermSize
> 
> > The permgen is actually a section of the heap.
> 
> Not really true.
> 
> > So if you want a 1GB permgen, you'll need at least
> > a 1GB heap size
> 
> Definitely not true.  Although PermGen is managed as a heap, it is
> sized independently of the main heap; the -Xmx size emphatically does
> NOT include space for PermGen.  PermGen and the main heap are allocated
> contiguously (in virtual space), but the sizes are unrelated.
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
> PROPRIETARY MATERIAL and is thus for use only by the intended
> recipient. If you received this in error, please contact the sender and
> delete the e-mail and its attachments from all computers.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

__________________________________________________________________________

Confidentiality Notice:  This Transmission (including any attachments) may contain information that is privileged, confidential, and exempt from disclosure under applicable law.  If the reader of this message is not the intended recipient you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited.  

If you have received this transmission in error, please immediately reply to the sender or telephone (512) 343-9100 and delete this transmission from your system.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Max value of MaxPermSize

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Jeffrey Janner [mailto:Jeffrey.Janner@PolyDyne.com] 
> Subject: RE: Max value of MaxPermSize

> The permgen is actually a section of the heap.

Not really true.

> So if you want a 1GB permgen, you'll need at least 
> a 1GB heap size

Definitely not true.  Although PermGen is managed as a heap, it is sized independently of the main heap; the -Xmx size emphatically does NOT include space for PermGen.  PermGen and the main heap are allocated contiguously (in virtual space), but the sizes are unrelated.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Max value of MaxPermSize

Posted by Jeffrey Janner <Je...@PolyDyne.com>.
The permgen is actually a section of the heap.
So if you want a 1GB permgen, you'll need at least a 1GB heap size, but you better make it much bigger than that, since you'll need more room for all the little things, like variable, objects, etc.
If you really need that large of a permgen, then you should probably take a good look at your app to figure out why.

(Actually, you probably need only a little more than the default 128Mb of PermGen, but your heap doesn't have enough room to expand it.  Try changing you settings below to -Xmx768m -XX:MaxPermSize:256m, and see if that helps.)

> -----Original Message-----
> From: abhishek jain [mailto:abhishek.netjain@gmail.com]
> Sent: Monday, April 04, 2011 3:09 AM
> To: Tomcat Users List
> Cc: Christopher Schultz
> Subject: Re: Max value of MaxPermSize
> 
> hi,
> I think the following line in
> /usr/local/jakarta/apache-tomcat-5.5.28/bin/catalina.sh
> 
> if [ -r "$CATALINA_HOME"/bin/tomcat-juli.jar ]; then
>   JAVA_OPTS="$JAVA_OPTS -server -Xms512m -Xmx512m -XX:MaxPermSize=1024m
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
> 
> LOGGING_CONFIG="-
> Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties"
> else
>   # Bugzilla 45585
>   LOGGING_CONFIG="-Dnop"
> fi
> 
> 
> 
> is  not making any differnece onthe memory consumed,as if i do
> 
> # free -m
>              total       used       free     shared    buffers
> cached
> Mem:          3072        696       2375          0          0
> 0
> -/+ buffers/cache:        696       2375
> Swap:            0          0          0
> 
> 
> the used space is 696 mb, where as , it should allocate more than that
> to
> java itself,
> 
> pl. advice how can i allocate more memory to java , as i am getting
> permgenerrorof memory (OutOfMemoryError: PermGen space)
> 
> thanks
> abhi
> 
> On Mon, Mar 21, 2011 at 8:03 PM, Christopher Schultz <
> chris@christopherschultz.net> wrote:
> 
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Abhishek,
> >
> > On 3/21/2011 6:14 AM, abhishek jain wrote:
> > >>> also am i writing these values in the correct location,
> > >>
> > >> With the tomcat base startup scripts, this should be in
> > >> $CATALINA_BASE/setenv.sh. This file will be sourced by catalina.sh
> if
> > >> it exists.
> > >>
> > > I have a feeling that i am writing in wrong place, setenv.sh dont
> > > exist in my system, do i need to create that
> >
> > Yes, you can create it. It's better to create this file because it
> won't
> > be overwritten by any Tomcat upgrades you might perform in the
> future.
> >
> > > or can i write directly in catalina.sh, if yes where to place this
> > > configuration.
> >
> > You *can* put this into catalina.sh, but it would be better not to.
> >
> > - -chris
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.10 (MingW32)
> > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> >
> > iEYEARECAAYFAk2HYboACgkQ9CaO5/Lv0PBPLwCgkNB2NMLGWsIHanH7emroXs2C
> > u88An2jZaM3mwkzRvQMTx7Eu0bCFeCDi
> > =xNcw
> > -----END PGP SIGNATURE-----
> >
> >
__________________________________________________________________________

Confidentiality Notice:  This Transmission (including any attachments) may contain information that is privileged, confidential, and exempt from disclosure under applicable law.  If the reader of this message is not the intended recipient you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited.  

If you have received this transmission in error, please immediately reply to the sender or telephone (512) 343-9100 and delete this transmission from your system.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org