Christophe,

On 4/8/22 12:57, Morfin, Christophe wrote:
Hi

Thank you for your answers,

Here below is the output of system part of hs_err file.


Note though If I execute a manual stop and manual start immediately after, this 
work, no issue.
It is only when I use the Restart option.

Both tests are done one after the other, so the overall amount of memory used 
on the machine at the time is the same in both cases.
When the service stops the committed memory goes down to 2.4 Gb, as nothing 
else is running on that machine, so there is plenty memory left to restart the 
process, which indeed happen when we use Stop then Start, but not with Restart.

I have spent some time with Microsoft too as I thought it was due to the OS, 
but they are telling me it is not and it is related to Tomcat.
I have a process dump that they help me collect. They mentioned it should be 
helpful to you to check with the symbols.
Let me know if you are interested about it.

You say you are using the Windows Services snap-in to restart this service. Is that using the standard Tomcat Service runner (procrun.exe / tomcatX.exe) to launch it?

One of the things that needs to be passed to that service-runner is the heap settings. When running from the command-line (typical for a *NIX deployment), there are two separate environment variables used for this purpose: CATALINA_OPTS and JAVA_OPTS.

JAVA_OPTS are passed to all invocations of the JVM, including the one that just launches a tiny Java thread to connect to the running Tomcat and give the "shutdown" command. CATALINA_OPTS is used only when *starting* Tomcat.

So if you put huge heap settings in JAVA_OPTS, your "shutdown" process allocates a huge heap for no reason. So it's best to put things like that into CATALINA_OPTS so you only get a huge heap for the real Tomcat service process.

Back to Windows Services.

If the "heap settings" are applying to both "startup" and "shutdown" processes, then your shutdown command may be allocating a large heap. If "shutdown" takes a few seconds, and "startup" happens while the old JVM is still running, you may have a situation where not everything can fit into memory all at once.

When you "stop" then "start", you may be adding enough of a a human-delay to that process so that the old JVM and the new JVM aren't running at the same time, so there is enough free memory to launch the new process.

-chris

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

Reply via email to