You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Leo Donahue - PLANDEVX <Le...@mail.maricopa.gov> on 2011/01/24 16:30:13 UTC

memory question - heap size and windows process

Is there a correlation between the heap size Tomcat is using and the memory allocated to the Tomcat process running as a windows service - depicted in task manager, or are these not related to one another?


Tomcat 6.0.29 - windows service - 512MB initial and max memory

Tomcat as listed in windows task manager: 312,664k

Tomcat as listed in jvisualvm:

Heap
Size: 518,979,584 B     Used: 175,853,040 B
Max: 518,979,584 B

PermGen
Size: 33,816,576 B      Used: 33,771,424 B
Max: 67,108,864 B

Leo


Re: memory question - heap size and windows process

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Leo,

On 1/24/2011 5:15 PM, Leo Donahue - PLANDEVX wrote:
> Memory Usage, not Memory Usage Delta.

I have the following choices in Microsoft Windows Task Manager:
Memory - Working Set
Memory - Peak Working Set
Memory - Working Set Delta
Memory - Private Working Set
Memory - Commit Size
Memory - Paged Pool
Memory - Non-paged Pool

Process Explorer shows several other fields as well.

> Yes, but asking the right question is the hardest part.

Er, okay. Well, with a 512MiB Java heap, I would expect more than 512MiB
of memory usage. That's the best I can do right now :)

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

iEYEARECAAYFAk0+PHAACgkQ9CaO5/Lv0PDL8ACfZPGxv0zqvlwgx90N0YvxwOKq
VN0AoLLOYK9LYrbwMBs+7xzW/AHIBhaT
=pyde
-----END PGP SIGNATURE-----

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


RE: memory question - heap size and windows process

Posted by Leo Donahue - PLANDEVX <Le...@mail.maricopa.gov>.
Chris,

Sorry about the long delay, Exchange took a break this morning.

>-----Original Message-----
>From: Christopher Schultz [mailto:chris@christopherschultz.net]
>Subject: Re: memory question - heap size and windows process
>
>Leo,
>
>On 1/24/2011 10:30 AM, Leo Donahue - PLANDEVX wrote:
>> Is there a correlation between the heap size Tomcat is using and the
>memory allocated to the Tomcat process running as a windows service -
>depicted in task manager, or are these not related to one another?
>
>Well, one would expect that as heap size increases, so does the total
>amount of memory allocated to the process, but I'm guessing you were
>hoping for something more helpful :)
>
>> Tomcat 6.0.29 - windows service - 512MB initial and max memory
>
>So you are trying to get a fixed heap size: okay.
>
>> Tomcat as listed in windows task manager: 312,664k
>
>That seems strange: I would expect the JVM to pre-allocate the entire
>heap (512MiB) plus allocate everything else it might need (PermGen,
>stack space, native heap, etc.) so you should exceed 512MiB as soon as
>the process launches.
>
>Which number are you observing in the Windows Task Manager? It can show
>you a lot of different memory numbers.
>

Memory Usage, not Memory Usage Delta.

>>
>> Tomcat as listed in jvisualvm:
>>
>> Heap
>> Size: 518,979,584 B     Used: 175,853,040 B
>> Max: 518,979,584 B
>
>That looks right.
>
>> PermGen
>> Size: 33,816,576 B      Used: 33,771,424 B
>> Max: 67,108,864 B
>
>Okay, so you have 512MiB of Java heap and 30MiB of PermGen so your
>process should take at minimum 542MiB of space. I'd be shocked if you
>had less than a 300MiB virtual size, though the memory might not
>actually be used at this point, so Microsoft Windows might not report
>it.
>
>I don't know much about Microsoft Windows, but I know that Linux doesn't
>even allocate memory to you until you actually write to it, so the
>actual amount of memory allocated to a JVM can be quite modest compared
>to the amount you expected to use upon JVM launch. Perhaps Microsoft
>Windows does something similar... though that would have to be a
>relatively new improvement (Vista/7?).
>

Using Windows Server 2003 Standard R2

>
>Were you hoping to get an answer to a specific question?
>

Yes, but asking the right question is the hardest part.

Re: memory question - heap size and windows process

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Leo,

On 1/24/2011 10:30 AM, Leo Donahue - PLANDEVX wrote:
> Is there a correlation between the heap size Tomcat is using and the memory allocated to the Tomcat process running as a windows service - depicted in task manager, or are these not related to one another?

Well, one would expect that as heap size increases, so does the total
amount of memory allocated to the process, but I'm guessing you were
hoping for something more helpful :)

> Tomcat 6.0.29 - windows service - 512MB initial and max memory

So you are trying to get a fixed heap size: okay.

> Tomcat as listed in windows task manager: 312,664k

That seems strange: I would expect the JVM to pre-allocate the entire
heap (512MiB) plus allocate everything else it might need (PermGen,
stack space, native heap, etc.) so you should exceed 512MiB as soon as
the process launches.

Which number are you observing in the Windows Task Manager? It can show
you a lot of different memory numbers.

> Tomcat as listed in jvisualvm:
> 
> Heap
> Size: 518,979,584 B     Used: 175,853,040 B
> Max: 518,979,584 B

That looks right.

> PermGen
> Size: 33,816,576 B      Used: 33,771,424 B
> Max: 67,108,864 B

Okay, so you have 512MiB of Java heap and 30MiB of PermGen so your
process should take at minimum 542MiB of space. I'd be shocked if you
had less than a 300MiB virtual size, though the memory might not
actually be used at this point, so Microsoft Windows might not report it.

I don't know much about Microsoft Windows, but I know that Linux doesn't
even allocate memory to you until you actually write to it, so the
actual amount of memory allocated to a JVM can be quite modest compared
to the amount you expected to use upon JVM launch. Perhaps Microsoft
Windows does something similar... though that would have to be a
relatively new improvement (Vista/7?).

Were you hoping to get an answer to a specific question?

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

iEYEARECAAYFAk09rysACgkQ9CaO5/Lv0PDq9gCfaT2xFUrnwtJvOb89SnWyxCOp
nQUAn0vbcWidy7td31QjB+EL9qSXyomP
=wngS
-----END PGP SIGNATURE-----

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