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