-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Andreas,

On 9/14/20 05:03, Döscher, Andreas (ESI) wrote:
> Moin, ah! The no-xmx-mistake! If you ommit the memory limitation,
> java uses (on server-class machines) as default 1/4 of the
> physical memory. (I found this blog entry
>
https://blog.openj9.org/2020/04/30/default-java-maximum-heap-size-is-cha
nged-for-java-8/)

It's more complicated than that, but yes, Arshiya I believe what you are
seeing is completely normal. When there is no memory pressure, the GC
won't actually do anything for a loooong time. And you'll see the
maximum heap space used. Since you didn't pick a maximum heap space on
startup, the JVM picked a "reasonable" one for you. Its definition of
"reasonable" may not match yours. :)

Try adding this to whatever launches your JVM:

  -Xmx32M

That's usually enough to run Tomcat and an application that doesn't
need very much memory. I've been able to get an application to run in
12MiB before, but IIRC it required disabling a few things Tomcat does
out-of-the-box to fully-adhere to the servlet and other specifications.

- -chris

> -----Ursprüngliche Nachricht----- Von: Arshiya Shariff
> <arshiya.shar...@ericsson.com.INVALID> Gesendet: Montag, 14.
> September 2020 10:17 An: Tomcat Users List
> <users@tomcat.apache.org> Betreff: RE: Track native memory of a
> Tomcat application
>
> Hi All,
>
> Thank you for the response Christopher .
>
> * A single request, or a single *type* of request? A single
> request (http/https) that is hit once per day
>
> * Does it increase as the request is processed, or does the JVM
> take
that 4GiB immediately upon startup?
> The tomcat process was started 3 months back , but the memory has
increased gradually to 4GB though it does not process requests
continuously (one request per day).
>
> * The first thing to do would be to post the effective
> command-line
options that are being used when launching your JVM. One of the
easiest ways to do that is to run "ps | grep catalina" which will give
you the full command-line for the process.
> There is no Xmx set: ogw      30853  0.1  3.1 22048736 2068856 ? Sl
> Jun09 154:10
/opt/java//jdk1.8.0_201-amd64/bin/java
- -Djava.util.logging.config.file=/opt/webstart//conf/logging.properties
- -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
- -Djdk.tls.ephemeralDHKeySize=2048
- -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
- -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
- -Dorg.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=false
- -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=false
- -Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=false
- -Dorg.apache.catalina.connector.RECYCLE_FACADES=false
- -Dignore.endorsed.dirs= -classpath
/opt/webstart//bin/bootstrap.jar:/opt/webstart//bin/tomcat-juli.jar
- -Dcatalina.base=/opt/webstart/ -Dcatalina.home=/opt/webstart/
- -Djava.io.tmpdir=/opt/webstart//temp
org.apache.catalina.startup.Bootstrap start
>
> Thanks and Regards Arshiya Shariff
>
>
> -----Original Message----- From: Christopher Schultz
> <ch...@christopherschultz.net> Sent: Friday, September 11, 2020
> 10:54 PM To: users@tomcat.apache.org Subject: Re: Track native
> memory of a Tomcat application
>
> Arshiya,
>
> On 9/11/20 13:06, Arshiya Shariff wrote:
>> We have a standalone tomcat web application(Version 9.0.22)
>> which runs on Linux . The application is used to process only  a
>> single http request.
>
> A single request, or a single *type* of request?
>
>> But the physical memory usage of the application has increased
>> to 4GB (output from the "top" command of Linux) , of which the
>> heap has only 16 MB of live data.
>
> Does it increase as the request is processed, or does the JVM take
> that 4GiB immediately upon startup?
>
> Remember that the heap is only a part of the JVM's memory usage.
> Examples of things that don't go into the heap are the native
> memory used by the JVM itself (thinking of the JVM itself as a
> usual OS process), stacks for each native thread, compiled Java
> code produced by the JIT, and various I/O buffers.
>
>> Is there a way to track the native memory of a tomcat process ?
>
> The native memory of a Java application is very difficult to
> inspect, etc. unless you are *very* familiar with JVMs, the memory
> manager being used by your JVM, and the platform and architecture
> on which the JVM is running.
>
> The first thing to do would be to post the effective command-line
> options that are being used when launching your JVM. One of the
> easiest ways to do that is to run "ps | grep catalina" which will
> give you the full command-line for the process.
>
> That will show any memory parameters you may have specified on the
> JVM at launch time, which will definitely affect the amount of
> native memory your JVM process might end up taking up.
>
> -chris
>
> ---------------------------------------------------------------------
>
>
>
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
>
> ---------------------------------------------------------------------
>
>
>
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl9fczEACgkQHPApP6U8
pFgMVxAAl77eabUTJdD3YgXdOy8Huzxq+yFNCOKXHlQBVgu1OpCIsQDc2t+/1xiy
MDyZrm/jCCbO8J0j+1mLaA0qOIxa49OtHKRmDUWFGYQX+RYBS/KDz4FKIaHD957j
vYDpDTBz4b+iTlhDgHymLjZiVzang+UDBsDZwWvZBrTj3DKw9wvAhPkJ/45bSKFt
BgB6tbOLoFk5qkbonq8nCq0tv2pCR8FgyG9vR/dadhDLbsi1EZKFBfxxCaewvCeV
G8O9fT9x5ZeslJbrz5LpB+BgjG382NPsB8eh57yCNZEMCObWINMKEeT4B9S0KXyu
5SSb9GMmtVg0J2RCwIJR1Rteyv/SwZshqOxK5h4EvCP09Bow9ZoQB6Jd1aDl8gX3
isnTaAUf0ocNVMzVuPUJf6sIk0Zj7yE5G+B27HfRdneZRGSmSerkw7JOjI0VK1fU
yYRcbc04jiyZMyoSetFmzTllgawXVQpVjUivjlI9N0rswf1KE3I+MCUXK5imqlzV
/HZlJc1OZrHljpT1VlMzUpEDePyqKk5IVkbbPPfMGxYyxvlttOy5WZSi2VTLh1m6
LFG+68rWpa7EhIzLXIblTUctf5pttwQ98525ID5sPEyHoaIHnFGldmWF/XKEMu8E
VqYn88oNIbF5XW8KJsVymrxwfKN5bu610uaCkpAIg4TJSGPj5Yk=
=7IsU
-----END PGP SIGNATURE-----

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

Reply via email to