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



  

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