Re: tomcat memory usage

2010-02-02 Thread Dan Armbrust
Nope, but I'm not an expert with these (at all).

I use something pretty similar, the only real difference is that I
haven't turned on the CMSIncrementalMode.  My apps haven't shown an
issue with long pause times, so I haven't researched/tested it yet.

Dan

On Tue, Feb 2, 2010 at 1:55 PM, Carl  wrote:
> Dan,
>
> These are the Javs opts currently set in catalina.sh:
>
> JAVA_OPTS="-Xms512m -Xmx512m -XX:PermSize=384m -XX:MaxPermSize=384m
> -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+PrintGCDetails
> -XX:+PrintGCTimeStamps -XX:+HeapDumpOnOutOfMemoryError
> -XX:HeapDumpPath=/usr/local/tomcat/logs"
> Do you see anything dangerous/wrong/not good?
>
> Thanks,
>
> Carl

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



Re: tomcat memory usage

2010-02-02 Thread Carl

Dan,

These are the Javs opts currently set in catalina.sh:

JAVA_OPTS="-Xms512m -Xmx512m -XX:PermSize=384m -XX:MaxPermSize=384m -XX:+UseConcMarkSweepGC 
-XX:+CMSIncrementalMode -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+HeapDumpOnOutOfMemoryError 
-XX:HeapDumpPath=/usr/local/tomcat/logs"

Do you see anything dangerous/wrong/not good?

Thanks,

Carl

- Original Message - 
From: "Dan Armbrust" 

To: "Tomcat Users List" ; 
Sent: Tuesday, February 02, 2010 2:07 PM
Subject: Re: tomcat memory usage



FYI - look out for this WRT MaxNewSize and NewRatio:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6862534

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





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



Re: tomcat memory usage

2010-02-02 Thread Dan Armbrust
FYI - look out for this WRT MaxNewSize and NewRatio:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6862534

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



Re: tomcat memory usage

2010-01-29 Thread Pid

On 29/01/2010 15:27, Caldarale, Charles R wrote:

From: Pid [mailto:p...@pidster.com]
Subject: Re: tomcat memory usage

So the MaxNewSize, despite often being seen at high values in
jmap outputs, is actually only applicable if the 'mx' allows it?


Correct.  Do you have an example of an erroneous MaxNewSize display?  I seem to 
recall some problems with 32-bit JVMs and incorrect treatment of unsigned 
integers causing problems in the past.


Not to hand, I'll poke around.

Probably the source of my confusion is that I think I remember seeing 
the default value of MaxNewSize as 4096M, despite having manually set a 
lower value for mx.



p



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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




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



RE: tomcat memory usage

2010-01-29 Thread Caldarale, Charles R
> From: Pid [mailto:p...@pidster.com]
> Subject: Re: tomcat memory usage
> 
> So the MaxNewSize, despite often being seen at high values in
> jmap outputs, is actually only applicable if the 'mx' allows it?

Correct.  Do you have an example of an erroneous MaxNewSize display?  I seem to 
recall some problems with 32-bit JVMs and incorrect treatment of unsigned 
integers causing problems in the past.

 - 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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat memory usage

2010-01-29 Thread Pid

On 29/01/2010 15:13, Caldarale, Charles R wrote:

From: Pid [mailto:p...@pidster.com]
Subject: Re: tomcat memory usage



The overall size of the heap is controlled by 3 different groups of
settings, not just the one you referred to:
   -Xms512M  -Xmx512M
   -XX:NewSize=32m   -XX:MaxNewSize=4096m
   -XX:PermSize=64m  -XX:MaxPermSize=128m

The overall amount of memory used is the sum of current values of each
these groups, plus non-heap memory.

(How'd I do?)


Not well.  The -Xmx and -Xms values include the NewSize; it is not a separate 
portion of the memory space as PermGen is.


Dagnamit.  So the MaxNewSize, despite often being seen at high values in 
jmap outputs, is actually only applicable if the 'mx' allows it?



p



  - 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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




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



RE: tomcat memory usage

2010-01-29 Thread Caldarale, Charles R
> From: Pid [mailto:p...@pidster.com]
> Subject: Re: tomcat memory usage

> The overall size of the heap is controlled by 3 different groups of
> settings, not just the one you referred to:
>   -Xms512M  -Xmx512M
>   -XX:NewSize=32m   -XX:MaxNewSize=4096m
>   -XX:PermSize=64m  -XX:MaxPermSize=128m
> 
> The overall amount of memory used is the sum of current values of each
> these groups, plus non-heap memory.
> 
> (How'd I do?)

Not well.  The -Xmx and -Xms values include the NewSize; it is not a separate 
portion of the memory space as PermGen is.

 - 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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: tomcat memory usage

2010-01-29 Thread Caldarale, Charles R
> From: Hüsnü Þentürk [mailto:husnusent...@yahoo.com]
> Subject: Re: tomcat memory usage
> 
> Is following classifications true for memory usage of Java ?

Pretty much, but you're missing ancillary bits such as libraries, OS-created 
structures, statically linked code, dynamically generated code, stacks, and 
probably other things I'm leaving out.  Running a process in a modern OS is 
complicated.

> Sum of PermGen and Heap memory usage smalller then 600,980 KB which
> I see on Task Manager. Can you explain the reason of this difference?

Just because the virtual space is reserved doesn't mean it's actually being 
used in real memory.  I don't know which of the memory values you chose to 
display in Task Manager, but it's probably real memory usage, which is only 
that part of the process space that the OS happens to have loaded at that 
instant.  Nearly all components of memory usage change over time, both in 
virtual space and real, and there is no definitive relationship between the 
two.  In other words, the Task Manager number is not terribly useful for tuning 
a Java execution, but it does provide some information when you're looking at 
the system as a whole.

 - 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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat memory usage

2010-01-29 Thread Pid

On 29/01/2010 14:11, Hüsnü Þentürk wrote:

Chuck and Chris,
Thanks for yor explanations,

Let me, try to summarize what I understand  adding some extra info and ask my 
questions.

Is following classifications true for memory usage of Java ? If not please 
correct it.

A. Java memory usage when application is started as a windows service:
1. Heap memory
* objects
2. Non-heap memory
* PermGen (holds reflective data (meta-data) of the JVM itself, such as 
class and method objects and static fields )
* JVM's itself ( Garbage collector, managing heap etc.)
* Java service wrapper dlls.

B. Java memory usage when application is with a batch file:
1. Heap memory
* objects
2. Non-heap memory
* PermGen (holds reflective data (meta-data) of the JVM itself, such as 
class and method objects and static fields )
* JVM's itself ( Garbage collector, managing heap etc.)


If I turn my first e-mail, in my example, java heap size was 512 MB, I did'nt 
define  PermSize parameter so application uses default value 64 MB. Sum of 
PermGen and Heap memory usage smalller then 600,980 KB which I see on Task 
Manager. Can you explain the reason of this difference?

  Heap PermGen
512 MB+   64 MB= 576 MB = 589824 KB<600980 KB

Firs e-mail
"In our company, we are using apache tomcat as a windows service. We defined jvm parameters 
"--JvmMs 512 --JvmMx 512" in service.bat. But application is using 600,980 KB memory. I 
expect the application not to use more then 512 MB."


The overall size of the heap is controlled by 3 different groups of 
settings, not just the one you referred to:


 -Xms512M  -Xmx512M

 -XX:NewSize=32m   -XX:MaxNewSize=4096m

 -XX:PermSize=64m  -XX:MaxPermSize=128m

The overall amount of memory used is the sum of current values of each 
these groups, plus non-heap memory.



(How'd I do?)


p




From: "Caldarale, Charles R"
To: Tomcat Users List
Sent: Wed, January 27, 2010 10:32:01 PM
Subject: RE: tomcat memory usage


From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Subject: Re: tomcat memory usage

What else goes into PermGen, other than java.lang.Class objects?


It varies by JVM level.  In the original HotSpot implementation it was pretty 
much just the instances of java.lang.Class.  As things evolved, a lot of 
class/method/field metadata migrated into PermGen from the C heap, pushed 
there, I suspect, by the growing use and sophistication of JMX and JVMTI, as 
well as making it easier for GC to clean up dead classes.  AFAIK, none of these 
secondary structures are directly visible to Java code.

- 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.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com



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



Re: tomcat memory usage

2010-01-29 Thread Hüsnü Þentürk
Chuck and Chris,
Thanks for yor explanations,

Let me, try to summarize what I understand  adding some extra info and ask my 
questions.

Is following classifications true for memory usage of Java ? If not please 
correct it.

A. Java memory usage when application is started as a windows service:
1. Heap memory
* objects
2. Non-heap memory
* PermGen (holds reflective data (meta-data) of the JVM itself, such as 
class and method objects and static fields )
* JVM's itself ( Garbage collector, managing heap etc.)
* Java service wrapper dlls.
  
B. Java memory usage when application is with a batch file:
1. Heap memory
* objects
2. Non-heap memory
* PermGen (holds reflective data (meta-data) of the JVM itself, such as 
class and method objects and static fields )
* JVM's itself ( Garbage collector, managing heap etc.)


If I turn my first e-mail, in my example, java heap size was 512 MB, I did'nt 
define  PermSize parameter so application uses default value 64 MB. Sum of 
PermGen and Heap memory usage smalller then 600,980 KB which I see on Task 
Manager. Can you explain the reason of this difference? 
 
 Heap PermGen  
512 MB    +   64 MB    = 576 MB = 589824 KB <   600980 KB
 
Firs e-mail
"In our company, we are using apache tomcat as a windows service. We defined 
jvm parameters "--JvmMs 512 --JvmMx 512" in service.bat. But application is 
using 600,980 KB memory. I expect the application not to use more then 512 MB. "
 
 
Thanks again.

 




From: "Caldarale, Charles R" 
To: Tomcat Users List 
Sent: Wed, January 27, 2010 10:32:01 PM
Subject: RE: tomcat memory usage

> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Subject: Re: tomcat memory usage
> 
> What else goes into PermGen, other than java.lang.Class objects?

It varies by JVM level.  In the original HotSpot implementation it was pretty 
much just the instances of java.lang.Class.  As things evolved, a lot of 
class/method/field metadata migrated into PermGen from the C heap, pushed 
there, I suspect, by the growing use and sophistication of JMX and JVMTI, as 
well as making it easier for GC to clean up dead classes.  AFAIK, none of these 
secondary structures are directly visible to Java code.

- 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.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

RE: tomcat memory usage

2010-01-27 Thread Caldarale, Charles R
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Subject: Re: tomcat memory usage
> 
> What else goes into PermGen, other than java.lang.Class objects?

It varies by JVM level.  In the original HotSpot implementation it was pretty 
much just the instances of java.lang.Class.  As things evolved, a lot of 
class/method/field metadata migrated into PermGen from the C heap, pushed 
there, I suspect, by the growing use and sophistication of JMX and JVMTI, as 
well as making it easier for GC to clean up dead classes.  AFAIK, none of these 
secondary structures are directly visible to Java code.

 - 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.



Re: tomcat memory usage

2010-01-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 1/27/2010 2:50 PM, Caldarale, Charles R wrote:
>> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
>> Subject: Re: tomcat memory usage
>>
>> The compiler knows that the "staticObject" member is static, and might
>> even be able to tell the runtime that the object to be used for that
>> static member should go into PermGen.
> 
> You're confusing the reference with the object it points to. The
> field containing the reference is in PermGen, the object the reference refers
> to is in the main heap.

I /was/ confused about your description, and I was sure that the object
itself was stored in the heap. All you're saying is that, since Class
objects are stored in PermGen, the memory required for their static
object references is also stored in PermGen. That makes complete sense
to me.

>> The runtime doesn't know until the putstatic call that the object is
>> destined to be a static reference.
> 
> See above; "reference" != "object", but "reference" == pointer to
> "object".  (But I think you know that.)

Thanks for the OO semantics lesson, professor :) I think my above
statement was missing the "pointed to by a static reference".

> No, the object will never migrate to PermGen space.  (Nothing ever
> migrates across the PermGen / main heap boundary, in either
> direction.)

Good to know. What else goes into PermGen, other than java.lang.Class
objects?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktgoPUACgkQ9CaO5/Lv0PBmwQCeKZrCwPTT9Kp8V8qswxCZ4OKk
Q3AAoJpZYaVBSGoQPmYn1c92mGxSlsHk
=UiYy
-END PGP SIGNATURE-

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



RE: tomcat memory usage

2010-01-27 Thread Caldarale, Charles R
> From: Steffen Heil [mailto:li...@steffen-heil.de]
> Subject: AW: tomcat memory usage
> 
> I am not sure, where the Class objects themselfes reside.

They are in PermGen along with a very few other internally-generated structures.

> Whereever they are, static references are in there.

Actually, there's no requirement that static fields be in the java.lang.Class 
instance or even in PermGen, as long as the interpreter, the two JITs, and GC 
know how to find them.  It would be easy to locate static fields on the C heap, 
with just a pointer in the native part of the java.lang.Class instance to the 
location.  But I believe they actually are in PermGen, since that makes the 
card table marking easier when a reference field is updated via putstatic.

 - 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.



AW: tomcat memory usage

2010-01-27 Thread Steffen Heil
Hi

> So, static members are stored outside the heap? Where are they stored? 
> PermGen?

For sure, no.
ALL persistent java objects are on the heap. With optimization some very short 
living objects may reside on the stack only.

References to static objects ARE probably stored in PermGen, but the objects 
themselfes are surely not. They are created as any other object during object 
initialization using the new operator.

I am not sure, where the Class objects themselfes reside. Maybe they are on 
PermGen or they are in the heap and are referenced in PermGen. Whereever they 
are, static references are in there.

Regards,
  Steffen


smime.p7s
Description: S/MIME cryptographic signature


RE: tomcat memory usage

2010-01-27 Thread Caldarale, Charles R
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Subject: Re: tomcat memory usage
> 
> The compiler knows that the "staticObject" member is static, and might
> even be able to tell the runtime that the object to be used for that
> static member should go into PermGen.

You're confusing the reference with the object it points to.  The field 
containing the reference is in PermGen, the object the reference refers to is 
in the main heap.

> The runtime doesn't know until the putstatic call that the object is
> destined to be a static reference.

See above; "reference" != "object", but "reference" == pointer to "object".  
(But I think you know that.)

> any long-living, heap-allocated object could be attached to 
> a static member at any time without warning.

Sure; it happens all the time.

> Does that mean that the putstatic opcode likely does one of two things:
> 1. Immediately promote that object into the PermGen space
> 2. Marks the object as destined for PermGen so that the GC can move it
>whenever it wants

No, the object will never migrate to PermGen space.  (Nothing ever migrates 
across the PermGen / main heap boundary, in either direction.)

> In either case, each object would need not only a regular reference
> count but also a static reference count 

No Java GC mechanism has used reference counting for close to ten years now.  
All GC operations are performed by following reference chains from the roots 
(subject to a ton of acceleration techniques that avoid following all paths on 
all GCs).

> Why not just have objects that end up bound to static members
> grow old and move into the "old" generation just like most 
> long-lived objects?

They do exactly that.  The fact that a reference field is static says nothing 
about the expected lifetime of what the reference refers to.

 - 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.



Re: tomcat memory usage

2010-01-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 1/27/2010 1:50 PM, Caldarale, Charles R wrote:
>> From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
>> Subject: Re: tomcat memory usage
>> 
>> So, static members are stored outside the heap? Where are they
>> stored? PermGen?
> 
> They're definitely not in the main Java heap; I'm pretty sure they're
> in PermGen, although it's been awhile since I've looked at that code.
> Keeping them in PermGen makes it easier for the all the GC
> reference-chasing logic to work.

This seems fishy to me. Consider the following.

public class MyClass
{
  public static Object staticObject = "static";
}

The compiler knows that the "staticObject" member is static, and might
even be able to tell the runtime that the object to be used for that
static member should go into PermGen.

But, now what happens if some other code does this:

MyClass.staticObject = new String("new string");

(I intentionally used the "new" keyword to force a new object creation
at runtime... not sure what the compiler/runtime does with string
constants within the constant pool).

The bytecode for that looks roughly like this:

new String
ldc "new string"
invokespecial String.(String)
putstatic MyClass.staticObject

The runtime doesn't know until the putstatic call that the object is
destined to be a static reference. Even if the compiler and runtime were
to collude to make this happen in this contrived example, any
long-living, heap-allocated object could be attached to a static member
at any time without warning.

Does that mean that the putstatic opcode likely does one of two things:
1. Immediately promote that object into the PermGen space
2. Marks the object as destined for PermGen so that the GC can move it
   whenever it wants

In either case, each object would need not only a regular reference
count but also a static reference count in case the object was still
relevant but no longer bound to a static member, in which case it should
be moved /back/ into the regular heap?

That sounds like more work than is really necessary for the GC to
perform. Why not just have objects that end up bound to static members
grow old and move into the "old" generation just like most long-lived
objects?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktglCkACgkQ9CaO5/Lv0PDr3ACdGSJQxadZHAHx5bjyjSRDpqyL
/xEAn11hQJeGlz7H6dAlgecQElJTGSD0
=AKd+
-END PGP SIGNATURE-

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



RE: tomcat memory usage

2010-01-27 Thread Caldarale, Charles R
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Subject: Re: tomcat memory usage
> 
> So, static members are stored outside the heap? Where are they stored?
> PermGen?

They're definitely not in the main Java heap; I'm pretty sure they're in 
PermGen, although it's been awhile since I've looked at that code.  Keeping 
them in PermGen makes it easier for the all the GC reference-chasing logic to 
work.

 - 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.



Re: tomcat memory usage

2010-01-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 1/27/2010 11:28 AM, Caldarale, Charles R wrote:
>> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
>> Subject: Re: tomcat memory usage
>>
>> All Java objects and their associated data are stored 
>> within the heap.
> 
> Well... no. The OP's original question was about what was outside
> the
> -Xmx heap setting, and Class objects and the associated static fields
> are /not/ included in that value. Instances of java.lang.Class and the
> static fields are kept in PermGen, which is separate from the regular
> Java heap, and sized independently of -Xmx.

Fair enough.

>> Unless you are writing JNI code, then everything you are
>> effecting is happening in the heap.
> 
> Also not strictly true, since a major chunk of the JVM and JRE are
> native code, and consume considerable amounts of process space to
> implement the Java operations.

What I meant was that you can create as many objects as you want in Java
and you aren't really stepping outside the Java heap. If you write JNI
code, you can call malloc as much as you want and /that/ would be
outside the Java heap. The OP can only cause the JVM to allocate a lot
of memory for non-Java-heap items indirectly... say, but opening a bunch
of sockets, creating a bunch of threads, etc.

>> Static variables and references (which are the same thing,
>> depending on how you see things) are not special in any way
>> when it comes to memory use.
> 
> Other than their location outside of the -Xmx-controlled heap.

So, static members are stored outside the heap? Where are they stored?
PermGen?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktgiEkACgkQ9CaO5/Lv0PAKKACgmDoe/8LislL/gddXNbyaeENM
7ysAoI8pT7suqp0zPphCQEIng8K+1md1
=QVxm
-END PGP SIGNATURE-

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



RE: tomcat memory usage

2010-01-27 Thread Caldarale, Charles R
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Subject: Re: tomcat memory usage
> 
> All Java objects and their associated data are stored 
> within the heap.

Well... no.  The OP's original question was about what was outside the -Xmx 
heap setting, and Class objects and the associated static fields are /not/ 
included in that value.  Instances of java.lang.Class and the static fields are 
kept in PermGen, which is separate from the regular Java heap, and sized 
independently of -Xmx.

> Unless you are writing JNI code, then everything you are
> effecting is happening in the heap.

Also not strictly true, since a major chunk of the JVM and JRE are native code, 
and consume considerable amounts of process space to implement the Java 
operations.

> Static variables and references (which are the same thing,
> depending on how you see things) are not special in any way
> when it comes to memory use.

Other than their location outside of the -Xmx-controlled heap.

> It's the JVM itself which is allocating memory outside that heap.

And the OS and the various libraries used by the JVM.

> Many DLLs loaded into a process's memory space are, in fact, shared
> with many other processes.

They're shared in real memory, but not process space (virtual memory).

> the fact that WTM shows you only a single number for "memory" 
> means that you're not getting the whole story.

The Task Manager can actually show several memory-related values, including 
virtual memory and various working set sizes.  What's available to display 
depends heavily on the version of Windows one's using.

> So, maybe WTM is giving you a decent measure of what memory is actually
> being used by that process, specifically.

Yes, it's pretty decent these days.  Still has nothing to do with the Java 
heap, of course.

 - 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.



Re: tomcat memory usage

2010-01-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hüsnü,

On 1/27/2010 2:06 AM, Hüsnü Þentürk wrote:
> As far as I know, heap memory is used by objects. On the other hand,
> our application has static variables and references to the objects
> residing in heap area. Does it mean, static variables and references
> of our application are stored outside of reserved 512MB area? Or, the
> memory outside of 512MB reserved heap area used only by Java itself?

No. All Java objects and their associated data are stored within the
heap. Unless you are writing JNI code, then everything you are effecting
is happening in the heap. Static variables and references (which are the
same thing, depending on how you see things) are not special in any way
when it comes to memory use.

It's the JVM itself which is allocating memory outside that heap.
Memory, for instance, to help manage the heap itself. And all the
threads you've got running. And the garbage collector.

Basically:

total memory = heap memory + non-heap memory

Using JVM options, you can really only effect the heap memory size, the
PermGen space, and the size of thread stacks. Basically, there is going
to be some extra memory needed for non-heap stuff. Especially on
Windows, I've seen reports of non-heap memory piling up quite a bit.

Something else to note: Windows' Task Manager is a terrible tool for
memory profiling, even without regard to Java's GC/heap issues. WTM just
shows you a single number for "memory" and doesn't explain anything.
Many DLLs loaded into a process's memory space are, in fact, shared with
many other processes. For instance, win32.dll (or whatever it's called
these days) gets mapped-into practically every process that runs under
Microsoft Windows. The memory used by that DLL is proably counted
against that process in WTM, when a lot of it is really being shared by
all processes. Yes, there is a lot of process-private (and
thread-private) data, but the fact that WTM shows you only a single
number for "memory" means that you're not getting the whole story.

Hmm... I'm looking at SysInternals (yes, they've been bought but I pine
for Mark Russinovich's freedom) Process Explorer and it looks like WTM
might be giving you the "private working set" which is essentially the
memory that only that process is using. For instance, WTM reports that
firefox.exe right now is using ~575MiB. (The column explicitly says
"private working set" if I expand it enough).

Process Explorer reports:
Virtual Memory
  Private Bytes:  ~ 762MiB
  Peak Private Bytes: ~ 880MiB
  Virtual Size:   ~1108MiB

Physical Memory:
  Working Set:~ 599MiB
WS Private:   ~ 575MiB
WS Shareable: ~  23MiB
WS Shared:~  10MiB
  Peak Working Set:   ~ 835MiB

WTM has gotten a lot better since the last time I checked: you can
choose which columns to view and it has an array of memory-related data
you can display.

So, maybe WTM is giving you a decent measure of what memory is actually
being used by that process, specifically.

Anyhow, you have to realize that virtual machines are complex beasts and
that there's more going on that your own code running inside that VM.

Other than the surprising realization that a 512MiB heap yields a 600MiB
process, is there a particular problem with the difference, here?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktgYigACgkQ9CaO5/Lv0PAE4gCfe02Wp9q7LonyBl4a4b0+OyOP
AFcAnjxPJ0djagrgBSWAlrETrsHhEkWJ
=M6aj
-END PGP SIGNATURE-

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



Re: tomcat memory usage

2010-01-26 Thread Hüsnü Þentürk
As far as I know, heap memory is used by objects. On the other hand, our 
application has static variables and references to the objects residing in heap 
area. Does it mean, static variables and references of our application are 
stored outside of reserved 512MB area? Or, the memory outside of 512MB reserved 
heap area used only by Java itself?

 




From: Peter Crowther 
To: Tomcat Users List 
Sent: Tue, January 26, 2010 5:43:22 PM
Subject: Re: tomcat memory usage

2010/1/26 Hüsnü Þentürk 

> Hi,
> In our company, we are using apache tomcat as a windows service. We defined
> jvm parameters "--JvmMs 512 --JvmMx 512" in service.bat. But application is
> using 600,980 KB memory. I expect the application not to use more then 512
> MB.
>
> Can you explain me, the reason of this stuation.
>
> You are setting the memory that Java uses to store heap objects.  That is
not the only memory Java uses.  Other uses include:
- The JVM code itself;
- Native code stacks per-thread;
- Native objects such as sockets and threads;
- Any loaded DLLs.

You have no direct way of controlling the size of any of these.  If you want
to reduce Java's memory usage, you can reduce its heap space after
monitoring what the process' overheads are.

- Peter



  

Re: tomcat memory usage

2010-01-26 Thread Peter Crowther
2010/1/26 Hüsnü Þentürk 

> Hi,
> In our company, we are using apache tomcat as a windows service. We defined
> jvm parameters "--JvmMs 512 --JvmMx 512" in service.bat. But application is
> using 600,980 KB memory. I expect the application not to use more then 512
> MB.
>
> Can you explain me, the reason of this stuation.
>
> You are setting the memory that Java uses to store heap objects.  That is
not the only memory Java uses.  Other uses include:
- The JVM code itself;
- Native code stacks per-thread;
- Native objects such as sockets and threads;
- Any loaded DLLs.

You have no direct way of controlling the size of any of these.  If you want
to reduce Java's memory usage, you can reduce its heap space after
monitoring what the process' overheads are.

- Peter


Re: tomcat memory usage

2010-01-26 Thread Pid

On 26/01/2010 15:12, Hüsnü Þentürk wrote:

Hi,
In our company, we are using apache tomcat as a windows service. We defined jvm 
parameters "--JvmMs 512 --JvmMx 512" in service.bat. But application is using 
600,980 KB memory. I expect the application not to use more then 512 MB.

Can you explain me, the reason of this stuation.


Assuming they're actually working, those settings only govern the size 
of the heap.  The JVM uses memory for things that are not part of the heap.



p



Informations:
--
Server version: Apache Tomcat/6.0.20
Server built:   May 14 2009 01:13:50
Server number:  6.0.20.0
OS Name:Windows 2003
OS Version: 5.2
Architecture:   x86
JVM Version:1.5.0_04-b05
JVM Vendor: Sun Microsystems Inc.

Thanks.

Husnu Senturk






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



tomcat memory usage

2010-01-26 Thread Hüsnü Þentürk
Hi,
In our company, we are using apache tomcat as a windows service. We defined jvm 
parameters "--JvmMs 512 --JvmMx 512" in service.bat. But application is using 
600,980 KB memory. I expect the application not to use more then 512 MB. 

Can you explain me, the reason of this stuation.

Informations:
--
Server version: Apache Tomcat/6.0.20
Server built:   May 14 2009 01:13:50
Server number:  6.0.20.0
OS Name:    Windows 2003
OS Version: 5.2
Architecture:   x86
JVM Version:    1.5.0_04-b05
JVM Vendor: Sun Microsystems Inc.

Thanks.

Husnu Senturk


  

RE: Setting Tomcat memory usage

2008-04-25 Thread Caldarale, Charles R
> From: Chris Richmond [mailto:[EMAIL PROTECTED] 
> Subject: Setting Tomcat memory usage
> 
> set JAVA_OPTS = -Xms512m -Xmx512m

Take out the spaces around the equals sign.  Windows interprets the
above as a setting for "JAVA_OPTS " (note the trailing space) rather
than "JAVA_OPTS", so it will be ignored by the scripts.

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Setting Tomcat memory usage

2008-04-25 Thread Chris Richmond
Hello all,

 

I read the documentation on the Tomcat6 site and I have attempted to modify
the max jvm memory settings when tomcat starts up by modifying Catalina.bat,
but it *appears* to have no effect.

 

Here is a summary of the situation and what I have done.

 

I am using Tomcat6 stable release, WinXP, java 1.6

I am running tomcat from zip distribution and not from an installed windows
service.  I am using the startup/shutdown .bat files to start/stop my tomcat
instance 

I have run some test code in a simple web service inside of tomcat to
determine the max memory settings for the JVM that tomcat is using.

 

Runtime rt = Runtime.getRuntime();

return rt.maxMemory();

 

the value that gets returned : 66650112


I shutdown tomcat, and modified Catalina.bat with the following in the
JAVA_OPTS section(I included the surrounding remarks for context)

 

rem   JAVA_OPTS   (Optional) Java runtime options used when the "start",

rem   "stop", or "run" command is executed

set JAVA_OPTS = -Xms512m -Xmx512m

 

I then restarted tomcat, ran my service call above and it still returns the
same value for maxmemory from within my tomcat webservice.

 

>From reading the Tomcat Docs/ FAQ, and Googling I think that I am setting
what I need to set(Catalina.bat), but it seems to have no effect.

 

What resource am I not taking advantage of with this information, or what am
I missing to set the max memory usage in the JVM when Tomcat starts up?

 

Thank you for your time in reading this,

 

Chris



Re: Diagnosing Tomcat memory usage

2007-10-10 Thread Filip Hanik - Dev Lists

plug in a profiler,
I use www.yourkit.com, you can get memory stats, like the ones you wish 
for, live.

other profilers will do the job as well
Filip

Andrew Hole wrote:

I've an java application running under tomcat and in the last week
memory usage increase 50%, from 200M to 400M. I want to know exactly
why this happens. Some suggestion?

Thanks a lot

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Diagnosing Tomcat memory usage

2007-10-10 Thread Dan Armbrust
Actually, you have no idea how much your code actually increased it.
You just think it increased 50%, because that is what the OS sees.

If you were using 190 MB of memory before, the JVM may have left your
system usage at 200 MB.

Then, when your app bumps the memory up to 201 MB, the JVM needs to
get more memory from the system.  So it typically doubles what it
currently has allocated.  Thats why you jumped from 200 to 400.

So, while your usage may have only gone up by a few MB, due to a
higher concurrent load, whatever, it looks like it doubled, because
that is how the JVM behaves.  And the JVM will never release that
memory back to the system - it will stay at 400 MB until the next time
you restart it.

If you have a leak, and a few weeks from now, you use up all of the
400 MB, the next jump will probably be 800 MB.

If you want to find out how much memory you are actually using, you
need to look inside the VM, with a tool like "jstat" (part of java).




On 10/10/07, Andrew Hole <[EMAIL PROTECTED]> wrote:
> I've an java application running under tomcat and in the last week
> memory usage increase 50%, from 200M to 400M. I want to know exactly
> why this happens. Some suggestion?
>
> Thanks a lot
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Diagnosing Tomcat memory usage

2007-10-10 Thread Lyallex
Try Lambda Probe as recommended by other contributors to this list.

http://www.lambdaprobe.org/d/index.htm

I'm no expert with this tool but it's straightforward to install and I
think it may help you out a bit. The System Information/Memory
Utilization thing is particularly fascinating although I don't fully
understandthe output yet.

I also used the JProbe profiller some time ago to profile a running
instance of Weblogic, it had a fantastic real time heap analysis tool
that shows you exactly what's happening at runtime ... 2 million
String objects, where the heck did they come from ? It's not free
though as far as I know.

It might help




On 10/10/07, Andrew Hole <[EMAIL PROTECTED]> wrote:
> I've an java application running under tomcat and in the last week
> memory usage increase 50%, from 200M to 400M. I want to know exactly
> why this happens. Some suggestion?
>
> Thanks a lot
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Diagnosing Tomcat memory usage

2007-10-10 Thread Andrew Hole
I've an java application running under tomcat and in the last week
memory usage increase 50%, from 200M to 400M. I want to know exactly
why this happens. Some suggestion?

Thanks a lot

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat Memory Usage

2007-05-14 Thread Jerome Benezech
Thanks. Will ask the host provider to try that
(difficult to be on shared hosting :)

--- Per Johnsson <[EMAIL PROTECTED]> wrote:

> 
> Ok, turn on the -verbose:gc and -XX:+PrintGCDetails
> and see if you could
> find any strange things in the logs. 
> 
> I have seen that when the jvm is making big full
> garbage collection the
> jvm practicaly halts for several seconds which could
> cause some strange
> behaviors. We had for example a xsl-stylesheet which
> used the mozilla
> javascript functions and that singe stylesheet
> generated very big full
> gc's.
> 
> Check this page for which options you can run on
> your version of java
> 1.5 they are different depending on the versions.
> 
>
http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp
> 
> /Regards Per Jonsson
> 
> -Original Message-
> From: Jerome Benezech [mailto:[EMAIL PROTECTED] 
> Sent: den 14 maj 2007 12:33
> To: Tomcat Users List
> Subject: RE: Tomcat Memory Usage
> 
> Hi,
> We're on Java 1.5 and do not get any OutOfMemory but
> after some point,
> Tomcat uses 50% of the server memory and stops
> serving requests.
> 
> 
> --- Per Johnsson <[EMAIL PROTECTED]> wrote:
> 
> > Hi!
> > 
> > If you get OutOfMemory Errors and running java 1.6
> (maybe later 
> > versions of java 1.5) you can make the vm to save
> a memory dump which 
> > you could load in ie. YourKit java profiler. And
> After a crach you 
> > could analyse the memroy in your applications.
> > 
> > I did that resently and it works like a charm.
> > 
> > This is the parameters I used:
> > -verbose:gc
> > -XX:HeapDumpPath=C:\Java\heapdump
> > -XX:+HeapDumpOnOutOfMemoryError
> > -XX:+PrintGCDetails
> > 
> > You could also look in the gc_log, sometimes you
> could see what's 
> > released and what needs correcting when jvm is
> doing a full gc.
> > 
> > Hope it helps.
> > 
> > (If you don't run java6 I can recommend it, faster
> and better :-)
> > 
> > /Regards Per Jonsson
> > 
> > -Original Message-
> > From: Jerome Benezech [mailto:[EMAIL PROTECTED]
> > Sent: den 14 maj 2007 11:21
> > To: users@tomcat.apache.org
> > Subject: Tomcat Memory Usage
> > 
> > Hi all,
> > 
> > I run a cocoon webapp which is hosted on a shared
> Linux environnement 
> > and runs under tomcat 5.5.9.
> > There are about 7 applications running under that
> tomcat instance (2 
> > cocoon, at least 1 jsp, don't know for the
> others).
> > My host provider complains that he tomcat uses a
> lot of memory and 
> > that he needs to restart it every 4 hours to
> release the memory.
> > Tomcat runs as a daemon (started using jsvc) and
> with the following
> > parameters:
> > 
> > jsvc.exec -user tomcat -cp ./bootstrap.jar 
> > -Djava.endorsed.dirs=../common/endorsed
> > -java.awt.headless=true -Xmx5
> > -XX:MaxPermSize=300m -debug -outfile
> > ../logs/catalina.out -errfile ../logs/catalina.err
> -verbose 
> > org.apache.catalina.startup.Bootstrap
> > -security
> > 
> > I'm really not sure where to start looking: memory
> leak due to bad 
> > programming in the webapp or bad tomcat
> configuration leading to 
> > memory leaks.
> > I also noticed there are quiet a few links in
> google pointing to 
> > problems with Tomcat not releasing memory (objets
> not getting 
> > garbage-collected), although they are mostly
> related to Tomcat 4.x. 
> > What is the situation on with Tomcat 5.5.9 ?
> > 
> > I'm looking for help on what to look for, what
> configuration 
> > parameters should be used in production
> environnement, how can I 
> > pinpoint this memory problem ?
> > 
> > Cheers,
> > Jerome
> > 
> > 
> > 
> > 
> > Jerome Benezech
> > [EMAIL PROTECTED]
> > 
> >
>
-
> > To start a new topic, e-mail:
> > users@tomcat.apache.org To unsubscribe,
> > e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> > 
> >
>

> 
> > This e-mail and the information it contains may be
> privileged and/or 
> > confidential.  It is for the intended addressee(s)
> only.
> > The unauthorised use, disclosure or copying of
> this e-mail, or any 
> > information it contains, is prohibited.
> > If you a

RE: Tomcat Memory Usage

2007-05-14 Thread Per Johnsson

Ok, turn on the -verbose:gc and -XX:+PrintGCDetails and see if you could
find any strange things in the logs. 

I have seen that when the jvm is making big full garbage collection the
jvm practicaly halts for several seconds which could cause some strange
behaviors. We had for example a xsl-stylesheet which used the mozilla
javascript functions and that singe stylesheet generated very big full
gc's.

Check this page for which options you can run on your version of java
1.5 they are different depending on the versions.

http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp

/Regards Per Jonsson

-Original Message-
From: Jerome Benezech [mailto:[EMAIL PROTECTED] 
Sent: den 14 maj 2007 12:33
To: Tomcat Users List
Subject: RE: Tomcat Memory Usage

Hi,
We're on Java 1.5 and do not get any OutOfMemory but after some point,
Tomcat uses 50% of the server memory and stops serving requests.


--- Per Johnsson <[EMAIL PROTECTED]> wrote:

> Hi!
> 
> If you get OutOfMemory Errors and running java 1.6 (maybe later 
> versions of java 1.5) you can make the vm to save a memory dump which 
> you could load in ie. YourKit java profiler. And After a crach you 
> could analyse the memroy in your applications.
> 
> I did that resently and it works like a charm.
> 
> This is the parameters I used:
> -verbose:gc
> -XX:HeapDumpPath=C:\Java\heapdump
> -XX:+HeapDumpOnOutOfMemoryError
> -XX:+PrintGCDetails
> 
> You could also look in the gc_log, sometimes you could see what's 
> released and what needs correcting when jvm is doing a full gc.
> 
> Hope it helps.
> 
> (If you don't run java6 I can recommend it, faster and better :-)
> 
> /Regards Per Jonsson
> 
> -Original Message-
> From: Jerome Benezech [mailto:[EMAIL PROTECTED]
> Sent: den 14 maj 2007 11:21
> To: users@tomcat.apache.org
> Subject: Tomcat Memory Usage
> 
> Hi all,
> 
> I run a cocoon webapp which is hosted on a shared Linux environnement 
> and runs under tomcat 5.5.9.
> There are about 7 applications running under that tomcat instance (2 
> cocoon, at least 1 jsp, don't know for the others).
> My host provider complains that he tomcat uses a lot of memory and 
> that he needs to restart it every 4 hours to release the memory.
> Tomcat runs as a daemon (started using jsvc) and with the following
> parameters:
> 
> jsvc.exec -user tomcat -cp ./bootstrap.jar 
> -Djava.endorsed.dirs=../common/endorsed
> -java.awt.headless=true -Xmx5
> -XX:MaxPermSize=300m -debug -outfile
> ../logs/catalina.out -errfile ../logs/catalina.err -verbose 
> org.apache.catalina.startup.Bootstrap
> -security
> 
> I'm really not sure where to start looking: memory leak due to bad 
> programming in the webapp or bad tomcat configuration leading to 
> memory leaks.
> I also noticed there are quiet a few links in google pointing to 
> problems with Tomcat not releasing memory (objets not getting 
> garbage-collected), although they are mostly related to Tomcat 4.x. 
> What is the situation on with Tomcat 5.5.9 ?
> 
> I'm looking for help on what to look for, what configuration 
> parameters should be used in production environnement, how can I 
> pinpoint this memory problem ?
> 
> Cheers,
> Jerome
> 
> 
> 
> 
> Jerome Benezech
> [EMAIL PROTECTED]
> 
>
-
> To start a new topic, e-mail:
> users@tomcat.apache.org To unsubscribe,
> e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
>


> This e-mail and the information it contains may be privileged and/or 
> confidential.  It is for the intended addressee(s) only.
> The unauthorised use, disclosure or copying of this e-mail, or any 
> information it contains, is prohibited.
> If you are not an intended recipient, please contact the sender and 
> delete the material from your computer.
>


> 
> 
> 
>
-
> To start a new topic, e-mail:
> users@tomcat.apache.org
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


Jerome Benezech
[EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



This e-

RE: Tomcat Memory Usage

2007-05-14 Thread Jerome Benezech
Hi,
We're on Java 1.5 and do not get any OutOfMemory but
after some point, Tomcat uses 50% of the server memory
and stops serving requests.


--- Per Johnsson <[EMAIL PROTECTED]> wrote:

> Hi!
> 
> If you get OutOfMemory Errors and running java 1.6
> (maybe later versions
> of java 1.5) you can make the vm to save a memory
> dump which you could
> load in ie. YourKit java profiler. And After a crach
> you could analyse
> the memroy in your applications. 
> 
> I did that resently and it works like a charm.
> 
> This is the parameters I used:
> -verbose:gc
> -XX:HeapDumpPath=C:\Java\heapdump
> -XX:+HeapDumpOnOutOfMemoryError
> -XX:+PrintGCDetails
> 
> You could also look in the gc_log, sometimes you
> could see what's
> released and what needs correcting when jvm is doing
> a full gc.
> 
> Hope it helps.
> 
> (If you don't run java6 I can recommend it, faster
> and better :-)
> 
> /Regards Per Jonsson
> 
> -Original Message-
> From: Jerome Benezech [mailto:[EMAIL PROTECTED] 
> Sent: den 14 maj 2007 11:21
> To: users@tomcat.apache.org
> Subject: Tomcat Memory Usage
> 
> Hi all,
> 
> I run a cocoon webapp which is hosted on a shared
> Linux environnement
> and runs under tomcat 5.5.9.
> There are about 7 applications running under that
> tomcat instance (2
> cocoon, at least 1 jsp, don't know for the others).
> My host provider complains that he tomcat uses a lot
> of memory and that
> he needs to restart it every 4 hours to release the
> memory.
> Tomcat runs as a daemon (started using jsvc) and
> with the following
> parameters:
> 
> jsvc.exec -user tomcat -cp ./bootstrap.jar
> -Djava.endorsed.dirs=../common/endorsed
> -java.awt.headless=true -Xmx5
> -XX:MaxPermSize=300m -debug -outfile
> ../logs/catalina.out -errfile ../logs/catalina.err
> -verbose
> org.apache.catalina.startup.Bootstrap
> -security
> 
> I'm really not sure where to start looking: memory
> leak due to bad
> programming in the webapp or bad tomcat
> configuration leading to memory
> leaks.
> I also noticed there are quiet a few links in google
> pointing to
> problems with Tomcat not releasing memory (objets
> not getting
> garbage-collected), although they are mostly related
> to Tomcat 4.x. What
> is the situation on with Tomcat 5.5.9 ?
> 
> I'm looking for help on what to look for, what
> configuration parameters
> should be used in production environnement, how can
> I pinpoint this
> memory problem ?
> 
> Cheers,
> Jerome
> 
> 
> 
> 
> Jerome Benezech
> [EMAIL PROTECTED]
> 
>
-
> To start a new topic, e-mail:
> users@tomcat.apache.org To unsubscribe,
> e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
>

> This e-mail and the information it contains may be
> privileged and/or
> confidential.  It is for the intended addressee(s)
> only.
> The unauthorised use, disclosure or copying of this
> e-mail, or any information it contains, is
> prohibited. 
> If you are not an intended recipient, please contact
> the sender and delete the material from your
> computer.
>

> 
> 
> 
>
-
> To start a new topic, e-mail:
> users@tomcat.apache.org
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


Jerome Benezech
[EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat Memory Usage

2007-05-14 Thread Per Johnsson
Hi!

If you get OutOfMemory Errors and running java 1.6 (maybe later versions
of java 1.5) you can make the vm to save a memory dump which you could
load in ie. YourKit java profiler. And After a crach you could analyse
the memroy in your applications. 

I did that resently and it works like a charm.

This is the parameters I used:
-verbose:gc
-XX:HeapDumpPath=C:\Java\heapdump
-XX:+HeapDumpOnOutOfMemoryError
-XX:+PrintGCDetails

You could also look in the gc_log, sometimes you could see what's
released and what needs correcting when jvm is doing a full gc.

Hope it helps.

(If you don't run java6 I can recommend it, faster and better :-)

/Regards Per Jonsson

-Original Message-
From: Jerome Benezech [mailto:[EMAIL PROTECTED] 
Sent: den 14 maj 2007 11:21
To: users@tomcat.apache.org
Subject: Tomcat Memory Usage

Hi all,

I run a cocoon webapp which is hosted on a shared Linux environnement
and runs under tomcat 5.5.9.
There are about 7 applications running under that tomcat instance (2
cocoon, at least 1 jsp, don't know for the others).
My host provider complains that he tomcat uses a lot of memory and that
he needs to restart it every 4 hours to release the memory.
Tomcat runs as a daemon (started using jsvc) and with the following
parameters:

jsvc.exec -user tomcat -cp ./bootstrap.jar
-Djava.endorsed.dirs=../common/endorsed
-java.awt.headless=true -Xmx5
-XX:MaxPermSize=300m -debug -outfile
../logs/catalina.out -errfile ../logs/catalina.err -verbose
org.apache.catalina.startup.Bootstrap
-security

I'm really not sure where to start looking: memory leak due to bad
programming in the webapp or bad tomcat configuration leading to memory
leaks.
I also noticed there are quiet a few links in google pointing to
problems with Tomcat not releasing memory (objets not getting
garbage-collected), although they are mostly related to Tomcat 4.x. What
is the situation on with Tomcat 5.5.9 ?

I'm looking for help on what to look for, what configuration parameters
should be used in production environnement, how can I pinpoint this
memory problem ?

Cheers,
Jerome




Jerome Benezech
[EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



This e-mail and the information it contains may be privileged and/or
confidential.  It is for the intended addressee(s) only.
The unauthorised use, disclosure or copying of this e-mail, or any information 
it contains, is prohibited. 
If you are not an intended recipient, please contact the sender and delete the 
material from your computer.




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat Memory Usage

2007-05-14 Thread Jerome Benezech
Hi all,

I run a cocoon webapp which is hosted on a shared
Linux environnement and runs under tomcat 5.5.9.
There are about 7 applications running under that
tomcat instance (2 cocoon, at least 1 jsp, don't know
for the others).
My host provider complains that he tomcat uses a lot
of memory and that he needs to restart it every 4
hours to release the memory.
Tomcat runs as a daemon (started using jsvc) and with
the following parameters:

jsvc.exec -user tomcat -cp ./bootstrap.jar
-Djava.endorsed.dirs=../common/endorsed
-java.awt.headless=true -Xmx5
-XX:MaxPermSize=300m -debug -outfile
../logs/catalina.out -errfile ../logs/catalina.err
-verbose org.apache.catalina.startup.Bootstrap
-security

I'm really not sure where to start looking: memory
leak due to bad programming in the webapp or bad
tomcat configuration leading to memory leaks.
I also noticed there are quiet a few links in google
pointing to problems with Tomcat not releasing memory
(objets not getting garbage-collected), although they
are mostly related to Tomcat 4.x. What is the
situation on with Tomcat 5.5.9 ?

I'm looking for help on what to look for, what
configuration parameters should be used in production
environnement, how can I pinpoint this memory problem
?

Cheers,
Jerome




Jerome Benezech
[EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat memory usage.

2007-01-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ayusman,

Ayusman Dikshit wrote:
> Hi Christopher,
> any links to the following implementation of multiple instances available?

Read the file RUNNING.txt in your Tomcat distribution, particularly the
section titled "Advanced Configuration - Multiple Tomcat Instances".

Another option is to simply install Tomcat in another directory and run
it separately. I personally prefer the "multi-instance,
single-installation" strategy.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFrkLD9CaO5/Lv0PARAuCsAKC+1Asf20XGPZtpN6W4HxF4G1FtiACgjIj4
MbvZkDh81WQ6PnO055mP6c8=
=FcF/
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat memory usage.

2007-01-17 Thread Filip Hanik - Dev Lists
the 1GB limit is OS specific, on Solaris for example, and a 32bit VM we 
had the limit of -Xmx1850m

on a 64bit VM the limitation should be non existent

Filip

Stephen Caine wrote:

Ayusman,

I have a OS X server, running Tomcat 5.0.19. There are already three 
applications running but I will need one more application which is 
memory intensive.  I wanted to know how can I specify/increase the 
memroy requirements for my application or Tomcat application?  My new 
application may need RAM data of around 800MB - 1.5 GB; given the 
condition that the OS X Server Hard Ware is capable of providing this 
amount of memory, how do I claim it at Tomcat startup, so that my 
application goes smoothly.


Additionally is there any known issues in Tomcat while dealing with 
memory intensive applications?

Any inputs will be really helpful.


We use Tomcat 5.5.7 on a Mac Quad Server (4 gigs RAM).  Our default 
settings are:


-Xms200m -Xmx200m -XX:+MaxFDLimit -server -Djava.awt.headless=true

These work fine except when there are a very large number of 
application pages.  In this case we use:


-Xms1048m -Xmx1048m -XX:+MaxFDLimit -server -Djava.awt.headless=true 
-XX:MaxPermSize=256m


At this point in time, you cannot allocate more than 1 gig to the heap 
regardless of whether the machine itself has more RAM.  Initially we 
thought this would be a hindrance, however experience has shown us 
that this limitation has minimal impact.


Stephen Caine
Soft Breeze Systems, LLC

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.13/632 - Release Date: 
1/16/2007 4:36 PM






-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat memory usage.

2007-01-17 Thread Stephen Caine

Ayusman,

I have a OS X server, running Tomcat 5.0.19. There are already  
three applications running but I will need one more application  
which is memory intensive.  I wanted to know how can I specify/ 
increase the memroy requirements for my application or Tomcat  
application?  My new application may need RAM data of around 800MB  
- 1.5 GB; given the condition that the OS X Server Hard Ware is  
capable of providing this amount of memory, how do I claim it at  
Tomcat startup, so that my application goes smoothly.


Additionally is there any known issues in Tomcat while dealing with  
memory intensive applications?

Any inputs will be really helpful.


We use Tomcat 5.5.7 on a Mac Quad Server (4 gigs RAM).  Our default  
settings are:


-Xms200m -Xmx200m -XX:+MaxFDLimit -server -Djava.awt.headless=true

These work fine except when there are a very large number of  
application pages.  In this case we use:


-Xms1048m -Xmx1048m -XX:+MaxFDLimit -server -Djava.awt.headless=true - 
XX:MaxPermSize=256m


At this point in time, you cannot allocate more than 1 gig to the  
heap regardless of whether the machine itself has more RAM.   
Initially we thought this would be a hindrance, however experience  
has shown us that this limitation has minimal impact.


Stephen Caine
Soft Breeze Systems, LLC

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat memory usage.

2007-01-17 Thread Mikolaj Rydzewski

Ayusman Dikshit wrote:
any links to the following implementation of multiple instances 
available?

Unzip/untar, change listening port and you're ready.

--
Mikolaj Rydzewski <[EMAIL PROTECTED]>



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Tomcat memory usage.

2007-01-17 Thread Ayusman Dikshit

Hi Christopher,
any links to the following implementation of multiple instances available?

Regards,
Ayusman
On 1/17/07, Christopher Schultz <[EMAIL PROTECTED]> wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ayusman,

Ayusman Dikshit wrote:
> I wanted to know how can I specify/increase the memroy requirements for
my
> application or Tomcat application?

If you want to give this particular application more resources than you
want to share with the others, then you'll need another instance of
Tomcat. Running multiple instances of Tomcat is no big deal, and you get
the advantage of configuring the resource allocations for each one
separately.

For instance, you can leave your existing Tomcat instance alone and
create a new one that has 2GB memory allocated to it.

Tomcat does not contain any resource management features that will let
you allocate some memory for one web app and more for another. In fact,
that's probably a Java restriction and not an app server one.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFra+99CaO5/Lv0PARArhtAKC1Nw3TJMTCqqD3fOCHCZw6HaJgVACfQ0xi
F7ieC2CArmNO0abkXWFCT2w=
=yj6T
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
TIA,
Ayusman


Re: Tomcat memory usage.

2007-01-16 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ayusman,

Ayusman Dikshit wrote:
> I wanted to know how can I specify/increase the memroy requirements for my
> application or Tomcat application?

If you want to give this particular application more resources than you
want to share with the others, then you'll need another instance of
Tomcat. Running multiple instances of Tomcat is no big deal, and you get
the advantage of configuring the resource allocations for each one
separately.

For instance, you can leave your existing Tomcat instance alone and
create a new one that has 2GB memory allocated to it.

Tomcat does not contain any resource management features that will let
you allocate some memory for one web app and more for another. In fact,
that's probably a Java restriction and not an app server one.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFra+99CaO5/Lv0PARArhtAKC1Nw3TJMTCqqD3fOCHCZw6HaJgVACfQ0xi
F7ieC2CArmNO0abkXWFCT2w=
=yj6T
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat memory usage.

2007-01-16 Thread Ayusman Dikshit

Hi All,
I have a OS X server, running Tomcat 5.0.19.
There are already three applications running but I will need one more
application which is memory intensive.
I wanted to know how can I specify/increase the memroy requirements for my
application or Tomcat application?
My new application may need RAM data of around 800MB - 1.5 GB; given the
condition that the OS X Server Hard Ware is capable of providing this amount
of memory, how do I claim it at Tomcat startup, so that my application goes
smoothly.

Additionally is there any known issues in Tomcat while dealing with memory
intensive applications?
Any inputs will be really helpful.

TIA,
Ayusman


Re: tomcat memory usage.

2006-11-28 Thread xu cai

Rainer Jung,

thanks for ur reply.  I understand that JVM will use lots of memory besides
heap.

but I didn't see that the gap between the "heap" size and total memory size
can be stable.
it keeps on growing.

I list the pmap result below. there are lots of unknow memory allocated. Is
there any tool can list all memory allocated by jvm ?

4818: /usr/java/bin/java -Xmx512m -D_TOMCAT -server -Djava.endorsed.dirs=/op
0001  64K r-x--  /opt/jdk1.5.0_07/bin/java
0002E000  16K rwx--  /opt/jdk1.5.0_07/bin/java
00032000   33808K rwx--[ heap ]
C82F8000  32K rw--R[ anon ]
C83F8000  32K rw--R[ anon ]
C84F8000  32K rw--R[ anon ]
C85F8000  32K rw--R[ anon ]
C86F8000  32K rw--R[ anon ]
C87F8000  32K rw--R[ anon ]
C88F8000  32K rw--R[ anon ]
C89F8000  32K rw--R[ anon ]
C8AF8000  32K rw--R[ anon ]
C8BF8000  32K rw--R[ anon ]
C8CF6000  40K rw--R[ anon ]
C8DF8000  32K rw--R[ anon ]
C8EF8000  32K rw--R[ anon ]
C8FF8000  32K rw--R[ anon ]
C90F8000  32K rw--R[ anon ]
C91F8000  32K rw--R[ anon ]
C92F6000  40K rw--R[ anon ]
C93F6000  40K rw--R[ anon ]
C94F6000  40K rw--R[ anon ]
C95F6000  40K rw--R[ anon ]
C96F8000  32K rw--R[ anon ]
C97F8000  32K rw--R[ anon ]
C98F8000  32K rw--R[ anon ]
C99F8000  32K rw--R[ anon ]
C9AF6000  40K rw--R[ anon ]
C9BF6000  40K rw--R[ anon ]
C9CF6000  40K rw--R[ anon ]
C9DF6000  40K rw--R[ anon ]
C9EF8000  32K rw--R[ anon ]
C9FF8000  32K rw--R[ anon ]
CA0F8000  32K rw--R[ anon ]
CA1F8000  32K rw--R[ anon ]
CA2F8000  32K rw--R[ anon ]
CA3F8000  32K rw--R[ anon ]
CA4F8000  32K rw--R[ anon ]
CA5F8000  32K rw--R[ anon ]
CA6F8000  32K rw--R[ anon ]
CA7F8000  32K rw--R[ anon ]
CA8F8000  32K rw--R[ anon ]
CA9F8000  32K rw--R[ anon ]
CAAF8000  32K rw--R[ anon ]
CABF8000  32K rw--R[ anon ]
CACF8000  32K rw--R[ anon ]
CADF8000  32K rw--R[ anon ]
CAEF8000  32K rw--R[ anon ]
CAFF8000  32K rw--R[ anon ]
CB0F8000  32K rw--R[ anon ]
CB1F8000  32K rw--R[ anon ]
CB2F8000  32K rw--R[ anon ]
CB3F8000  32K rw--R[ anon ]
CB4F8000  32K rw--R[ anon ]
CB5F8000  32K rw--R[ anon ]
CB6F8000  32K rw--R[ anon ]
CB7F8000  32K rw--R[ anon ]
CB8F8000  32K rw--R[ anon ]
CB9F8000  32K rw--R[ anon ]
CBAF8000  32K rw--R[ anon ]
CBBF8000  32K rw--R[ anon ]
CBCF8000  32K rw--R[ anon ]
CBDF8000  32K rw--R[ anon ]
CBEF8000  32K rw--R[ anon ]
CBFF8000  32K rw--R[ anon ]
CC0F8000  32K rw--R[ anon ]
CC1F8000  32K rw--R[ anon ]
CC2F8000  32K rw--R[ anon ]
CC3F8000  32K rw--R[ anon ]
CC4F8000  32K rw--R[ anon ]
CC5F8000  32K rw--R[ anon ]
CC6F8000  32K rw--R[ anon ]
CC7F8000  32K rw--R[ anon ]
CC8F8000  32K rw--R[ anon ]
CC9F8000  32K rw--R[ anon ]
CCAF8000  32K rw--R[ anon ]
CCBF8000  32K rw--R[ anon ]
CCCF8000  32K rw--R[ anon ]
CCDF8000  32K rw--R[ anon ]
CCEF8000  32K rw--R[ anon ]
CCFF8000  32K rw--R[ anon ]
CD0F8000  32K rw--R[ anon ]
CD1F8000  32K rw--R[ anon ]
CD2F8000  32K rw--R[ anon ]
CD3F8000  32K rw--R[ anon ]
CD4F8000  32K rw--R[ anon ]
CD5F8000  32K rw--R[ anon ]
CD6F8000  32K rw--R[ anon ]
CD7F8000  32K rw--R[ anon ]
CD8F8000  32K rw--R[ anon ]
CD9F8000  32K rw--R[ anon ]
CDAF8000  32K rw--R[ anon ]
CDBF8000  32K rw--R[ anon ]
CDCF8000  32K rw--R[ anon ]
CDDF8000  32K rw--R[ anon ]
CDEF8000  32K rw--R[ anon ]
CDFF8000  32K rw--R[ anon ]
CE0F8000  32K rw--R[ anon ]
CE1F8000  32K rw--R[ anon ]
CE2F8000  32K rw--R[ anon ]
CE3F8000  32K rw--R[ anon ]
CE4F8000  32K rw--R[ anon ]
CE5F8000  32K rw--R[ anon ]
CE6F8000  32K rw--R[ anon ]
CE7F8000  32K rw--R[ anon ]
CE8F8000  32K rw--R[ anon ]
CE9F8000  32K rw--R[ anon ]
CEAF8000  32K rw--R[ anon ]
CEBF8000  32K rw--R[ anon ]
CECF8000  32K rw--R[ anon ]
CEDF8000  32K rw--R[ anon ]
CEEF8000  32K rw--R[ anon ]
CF1F4000  48K rw--R[ anon ]
CF2F4000  48K rw--R[ anon ]
CF3F4000  48K rw--R[ anon ]
CF4F6000  40K rw--R[ anon ]
CF5F6000  40K rw--R[ anon ]
CF6F6000  40K rw--R[ anon ]
CF7F6000  40K rw--R[ anon ]
CF8F6000  40K rw--R[ anon ]
CF9F6000  40K rw--R[ anon ]
CFAF6000  40K rw--R[ anon ]
CFBF6000  40K rw--R[ anon ]
CFCF6000  40K rw--R[ anon ]
CFDF6000  40K rw--R[ anon ]
CFEF6000  40K rw--R[ anon ]
CFFF6000  

RE: tomcat memory usage.

2006-11-21 Thread Steffen Heil
Hi

> Description :
> right after system(tomcat) is started, the "top" command show 
> that tomcat process will use 210M memory, the heap size 
> (using Jprofiler) is 58m/20m(total/used). there is a 150M gap 
> between total process memory size and java heap size.

There needs to be some memory for the JVM as well as your classes.
Furthermore GCs may keep two copies of the youngest generation part of the
heap.

>  So my questions are:
> 1,  what is the difference between java process memory size  
> and java heap size ? why can it be 150M in right after tomcat 
> is started ?
> 2,  why the gap between top can heap can grows from 150M to 
> 320M, where does 170M more memory gone ?

I assume it was needed in between.
However, memory allocated by the JVM not not neccessarily lost. Not being
used that may be swapped out.

Regards,
  Steffen


smime.p7s
Description: S/MIME cryptographic signature


tomcat memory usage.

2006-11-21 Thread xu cai

Env: Axis1.4/Tomcat 5.0.30/Java 1.5.0_07/Solaris 10.

Description :
right after system(tomcat) is started, the "top" command show that tomcat
process will use 210M memory, the heap size (using Jprofiler) is
58m/20m(total/used). there is a 150M gap between total process memory
size and java heap size.

I run a client to invoke the web service in a loop, couple houres later,
tomcat process memory size can grow to 510M, the heap size of is 190m/20m
(total/used). so the gap between process memory size and java heap size
grows to 320M.  From gc log, I didn't any thing weired since the used heap
size can keep at 20m, no memory leak can be found at jprofiler.

So my questions are:
1,  what is the difference between java process memory size  and java heap
size ? why can it be 150M in right after tomcat is started ?
2,  why the gap between top can heap can grows from 150M to 320M, where does
170M more memory gone ?


does anybody have simliar experience using axis/tomcat ? I need help

thanks
xucai

Client side code example:
*// get a port from client stub . ignored. *
* while (true) {
try {
long start=System.currentTimeMillis();
for ( int i=0; i<1000; i++) {
 String reply= port.request(command);  // web
service call
 System.out.print(".");
 }
 long end=System.currentTimeMillis();
 long used= (end-start)/1000;
 System.out.println();
 System.out.println("Time used: "+used);
 } catch(Exception e) {
 e.printStackTrace();
 }
} *


--
- xucai


Re: tomcat memory usage.

2006-11-21 Thread Rainer Jung
Usually the term heap is used for the sum of the new space, one of the
two semi spaces (both usually around a couple of MB) and tenured. The
size of each of these can be viewed e.g. with jconsole, which comes with
your JVM.

Additional memory is used for perm (class data), which should generally
be in the reange of 10-60MB, depending on how many classes you have.

Further memory is needed for thread stacks, native libs and in Java 1.5
for class sharing meta data.

You can have a look at the native side of things by the Solaris command
pmap.

On Solaris you should not use top. Use prstat instead.

Does the gap stabilize after some time?

Regards,

Rainer

xu cai schrieb:
> hi Steffen,
> 
> thanks for ur reply. I still have questions on that, see that in-line.
> 
> On 11/21/06, Steffen Heil <[EMAIL PROTECTED]> wrote:
>>
>> Hi
>>
>> > Description :
>> > right after system(tomcat) is started, the "top" command show
>> > that tomcat process will use 210M memory, the heap size
>> > (using Jprofiler) is 58m/20m(total/used). there is a 150M gap
>> > between total process memory size and java heap size.
>>
>> There needs to be some memory for the JVM as well as your classes.
>> Furthermore GCs may keep two copies of the youngest generation part of
>> the
>> heap.
> 
> 
> Yes, some memory is needed for JVM and classes, also GC keep copies of
> young
> generation part of heap.
> 
> Since the heap memory is managed well by GC, used heap memory grows from
> 20M
> to  160M gracefully and come back to 20M.
> But my question is why the total memory size of the process (tomcat) grows
> up from 230M to more than 520M.  there is no significant memory grow in
> java
> heap, why the total memory can grow up almost 300M ?
> 
>>  So my questions are:
>> > 1,  what is the difference between java process memory size
>> > and java heap size ? why can it be 150M in right after tomcat
>> > is started ?
>> > 2,  why the gap between top can heap can grows from 150M to
>> > 320M, where does 170M more memory gone ?
>>
>> I assume it was needed in between.
>> However, memory allocated by the JVM not not neccessarily lost. Not being
>> used that may be swapped out.
>>
>> Regards,
>> Steffen
>>
>>
>>
> 
> 

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat memory usage questions

2006-10-03 Thread Rizwan Merchant


Thanks for the response Robert.
Is it abnormal to see the mem usage % for tomcat to go as high as 80 or 
90%? Currently its only at 11%, but I am wondering at what point I 
should start panicking. :)


Robert Harper wrote:

The memory should peak at some point and the go up and down with need. There
are a few things you have to be aware of though. The garbage collector is a
very low priority thread so if your server never has a dull moment, you end
up exhausting memory just because the garbage collector does not get a
chance to run.

Care in development should be taken with respect to use of objects and
having circular references. You can cause memory leaks with circular
references because you might leave free and object from the servlet but then
have two objects referring to each other and the GC will not see them as
having gone out of scope. Another thing to think about is if you are doing a
lot of string concatenation the StringBuffer object is much better to use
than the String object. StringBuffer will be easier on memory and more
efficient.



Robert S. Harper
Information Access Technology, Inc.

-Original Message-
From: Rizwan Merchant [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 03, 2006 7:41 AM

To: tomcat
Subject: tomcat memory usage questions

Hi,
We recently developed and deployed a web based application using the 
following technologies...


Struts
Spring
Hibernate 3.0
Mysql 5.0
tomcat 5.5
Linux Fedora Core 4

After the system went live, I have been monitoring the CPU and memory 
usages. I dread the outOfMemory errors and am a little paranoid about it.


There are 2 main processes I am monitoring, tomcat and mysqld.
The tomcat process memory usage is slowly creeping up...after 8 hours of 
application usage it is at 13.3% and the mysqld memory usage is at 1.3%.


I am wondering what kind of pattern I should be observing for the memory 
usages. Should it go up and then down again (like the CPU usage)? Or is 
it ok for it to slowly go up (the way it is doing right now)? The swap 
memory is not being used, so I am guessing thats a good thing.


Also, someone told me that hibernate and spring will try and cache 
everything it can, which could be the cause of the memory creeping up 
slowly. Is this true? and if it is, will this be a problem when the 
memory gets to a high number like 80 or 90% ?


Also, is there a way to tell if there are any processes spawned by 
tomcat that are hanging around uselessly?


Any help, ideas, tips would be appreciated. I am just concerned about 
having any memory issues with this LIVE application.


Thanks,
-Riz.

<http://forum.springframework.org/newreply.php?do=newreply&p=79473>

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: tomcat memory usage questions

2006-10-03 Thread Caldarale, Charles R
> From: Robert Harper [mailto:[EMAIL PROTECTED] 
> Subject: RE: tomcat memory usage questions
> 
> Care in development should be taken with respect to use of objects and
> having circular references. You can cause memory leaks with circular
> references because you might leave free and object from the servlet
> but then have two objects referring to each other and the GC will not 
> see them as having gone out of scope.

Simply not true.  Only reference counter collectors have issues with
circular references, and no modern JVMs use that technique.  A set of
objects that are referenced only by themselves are not reachable from
the roots and are easily collectable.

Here's a decent reference for memory tuning:
http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat memory usage questions

2006-10-03 Thread Mikolaj Rydzewski

Robert Harper wrote:

Another thing to think about is if you are doing a
lot of string concatenation the StringBuffer object is much better to use
than the String object. StringBuffer will be easier on memory and more
efficient.
  
Unless you concatenate strings in multiple threads it's better to use 
StringBuilder.


--
Mikolaj Rydzewski <[EMAIL PROTECTED]>



smime.p7s
Description: S/MIME Cryptographic Signature


RE: tomcat memory usage questions

2006-10-03 Thread Robert Harper
The memory should peak at some point and the go up and down with need. There
are a few things you have to be aware of though. The garbage collector is a
very low priority thread so if your server never has a dull moment, you end
up exhausting memory just because the garbage collector does not get a
chance to run.

Care in development should be taken with respect to use of objects and
having circular references. You can cause memory leaks with circular
references because you might leave free and object from the servlet but then
have two objects referring to each other and the GC will not see them as
having gone out of scope. Another thing to think about is if you are doing a
lot of string concatenation the StringBuffer object is much better to use
than the String object. StringBuffer will be easier on memory and more
efficient.



Robert S. Harper
Information Access Technology, Inc.

-Original Message-
From: Rizwan Merchant [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 03, 2006 7:41 AM
To: tomcat
Subject: tomcat memory usage questions

Hi,
We recently developed and deployed a web based application using the 
following technologies...

Struts
Spring
Hibernate 3.0
Mysql 5.0
tomcat 5.5
Linux Fedora Core 4

After the system went live, I have been monitoring the CPU and memory 
usages. I dread the outOfMemory errors and am a little paranoid about it.

There are 2 main processes I am monitoring, tomcat and mysqld.
The tomcat process memory usage is slowly creeping up...after 8 hours of 
application usage it is at 13.3% and the mysqld memory usage is at 1.3%.

I am wondering what kind of pattern I should be observing for the memory 
usages. Should it go up and then down again (like the CPU usage)? Or is 
it ok for it to slowly go up (the way it is doing right now)? The swap 
memory is not being used, so I am guessing thats a good thing.

Also, someone told me that hibernate and spring will try and cache 
everything it can, which could be the cause of the memory creeping up 
slowly. Is this true? and if it is, will this be a problem when the 
memory gets to a high number like 80 or 90% ?

Also, is there a way to tell if there are any processes spawned by 
tomcat that are hanging around uselessly?

Any help, ideas, tips would be appreciated. I am just concerned about 
having any memory issues with this LIVE application.

Thanks,
-Riz.

<http://forum.springframework.org/newreply.php?do=newreply&p=79473>

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



tomcat memory usage questions

2006-10-03 Thread Rizwan Merchant

Hi,
We recently developed and deployed a web based application using the 
following technologies...


Struts
Spring
Hibernate 3.0
Mysql 5.0
tomcat 5.5
Linux Fedora Core 4

After the system went live, I have been monitoring the CPU and memory 
usages. I dread the outOfMemory errors and am a little paranoid about it.


There are 2 main processes I am monitoring, tomcat and mysqld.
The tomcat process memory usage is slowly creeping up...after 8 hours of 
application usage it is at 13.3% and the mysqld memory usage is at 1.3%.


I am wondering what kind of pattern I should be observing for the memory 
usages. Should it go up and then down again (like the CPU usage)? Or is 
it ok for it to slowly go up (the way it is doing right now)? The swap 
memory is not being used, so I am guessing thats a good thing.


Also, someone told me that hibernate and spring will try and cache 
everything it can, which could be the cause of the memory creeping up 
slowly. Is this true? and if it is, will this be a problem when the 
memory gets to a high number like 80 or 90% ?


Also, is there a way to tell if there are any processes spawned by 
tomcat that are hanging around uselessly?


Any help, ideas, tips would be appreciated. I am just concerned about 
having any memory issues with this LIVE application.


Thanks,
-Riz.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat memory usage 3.3 vs 5.5

2006-04-19 Thread Abhi Karmos

Hey thanks for your comments -

1. Our applications are fixed. We have removed all unnecessary apps.
2. Unwanted jars/classes are not loaded into physical memory by IBM JVM on 
Linux. So, it will not add to RSS. We have done some experiments and are 
sure of this claim.

Abhi.

"manivannan57" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> 1) Reduce the number of applications you load during start-up.
> 2) Remove unwanted jars from WEB-INF/lib and also from
> /common/lib
> 3) Also remove wherever the jars seem to be unnecessary.
>
>
> --
> View this message in context: 
> http://www.nabble.com/Tomcat-memory-usage-3.3-vs-5.5-t1472557.html#a3982404
> Sent from the Tomcat - User forum at Nabble.com. 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat memory usage 3.3 vs 5.5

2006-04-18 Thread manivannan57

1) Reduce the number of applications you load during start-up.
2) Remove unwanted jars from WEB-INF/lib and also from
/common/lib
3) Also remove wherever the jars seem to be unnecessary.


--
View this message in context: 
http://www.nabble.com/Tomcat-memory-usage-3.3-vs-5.5-t1472557.html#a3982404
Sent from the Tomcat - User forum at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat memory usage 3.3 vs 5.5

2006-04-18 Thread Abhi Karmos

Hello all,

We run tomcat inside an embedded system and we are planning to upgrade the 
tomcat version from 3.3.1 to 5.5.16. We noticed that the memory footprint of 
a barebones tomcat 5.5 installation is 44 MB. Plain and simple Tomcat 3.3 
used to run with 25 MB. We have limited memory on our system and the memory 
usage of tomcat 5.5 is a concern for us.

The numbers above are the resident set size (RSS) on a linux system. When we 
took the above numbers, both the tomcats had the same heap setting (min: 
25 - max: 30 mb).

When we run our webapps, which add another 20 jars in the classpath, the 
steady state memory usage is 50 MB with Tomcat 3.3 and 66 MB with Tomcat 
5.5.

Has anyone else solved a similar problem before ? Can I try and tweak tomcat 
5.5 to run in less memory ? Our server.xml is the minimal configuration 
possible.

Regards,
Abhi.

OS: Linux / RedHat 7.3
JVM: IBM 1.4.2 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]