Hello Christophe, On Tue, Apr 12, 2022 at 3:56 PM Morfin, Christophe <cmor...@ptc.com> wrote: > > Hi > > As additional information I have done further testing > > Windows 2016 32Gb RAM > Xms/Xmx 20g > Pagefile 5g >
Just wondering, how are you setting min and max heap now? By setting Xms and Xmx values in the Java tab OR by setting values in the "initial/max memory pool"? If you are using Xms and Xmx values, can you remove it and try to set heap via "initial/max memory pool" option? Just wanted to see if that makes any difference or not. > Service restart works fine > > Same configuration on Windows 2019, restart fails with mentioned memory issue. > > Windows 2019 8gb RAM > Xms/Xmx 7g > Pagefile 2g > Restart works fine > > So it seems to happen only on Windows 2019 with larger heap size. > This is indeed interesting. I don't have any Windows 2019 but I'll try with > Note that this was reported to me by others, so it appears to be easily > reproducible . > I wonder if you would have a chance to test on a Windows 2019 , 64 bit Build > 17763 (10.0.17763.2686) with above mentionned configuration as I feel you > would reproduce. > > Thank you > Kind regards > Christophe > > > > > > -----Original Message----- > From: Morfin, Christophe > Sent: 11 April 2022 09:38 > To: 'users@tomcat.apache.org' <users@tomcat.apache.org> > Subject: RE: Tomcat service does not restart on Windows with high value of > Xms/Xmx > > Hi Chris > > Thank you for the information, this is interesting indeed. > Yes, I am using the default service installed by Tomcat installer so using > procrun and tomcat9.exe > > I have tried adding -DCATALINA_OPTS="-Xms20g -Xmx20g" under the Java Options > parameters in tomcat9w.exe > Java tab But this is not taken into account > > When I google this, it seems we can't set CATALINA_OPTS when starting as a > service > > Do you have further details on how to set CATALINA_OPTS when starting a > service ? > > Thank you > Kind regards > Christophe > > > > > -----Original Message----- > From: Morfin, Christophe > Sent: 08 April 2022 17:57 > To: 'users@tomcat.apache.org' <users@tomcat.apache.org> > Subject: RE: Tomcat service does not restart on Windows with high value of > Xms/Xmx > > 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. > > Thank you > Christophe > > > > --------------- S Y S T E M --------------- > > OS: Windows Server 2019 , 64 bit Build 17763 (10.0.17763.2686) OS uptime: 0 > days 8:03 hours Hyper-V role detected > > CPU:total 8 (initial active 8) (4 cores per cpu, 2 threads per core) family 6 > model 85 stepping 7 microcode 0xffffffff, cmov, cx8, fxsr, mmx, sse, sse2, > sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, rtm, > 3dnowpref, lzcnt, ht, tsc, bmi1, bmi2, adx, evex, fma > > Memory: 4k page, system-wide physical 32767M (30013M free) TotalPageFile size > 37631M (AvailPageFile size 14413M) current process WorkingSet (physical > memory assigned to process): 12M, peak: 12M current process commit charge > ("private bytes"): 61M, peak: 20541M > > vm_info: OpenJDK 64-Bit Server VM (11.0.14+9-LTS) for windows-amd64 JRE > (11.0.14+9-LTS), built on Jan 15 2022 01:18:46 by "Administrator" with > unknown MS VC++:1916 > > END. > > > Christophe Morfin > Principal Technical Support Engineer > > 00800 782 4 4357 (00800 PTC 4 HELP) > cmor...@ptc.com > > thingworx.com > > > -----Original Message----- > From: Morfin, Christophe > Sent: 08 April 2022 15:10 > To: users@tomcat.apache.org > Subject: Tomcat service does not restart on Windows with high value of Xms/Xmx > > > > Hi > > I am using Tomcat 9.0.52 and 9.0.60 on Windows server 2019 version 1809 (OS > Build 17763.2686) The machine has 32Gb of Ram Pagefile size 4Gb The Tomcat > service is configured with Xms20g Xmx20g added in the Java 8 parameters I am > using Amazon corretto 11.0.14 > > Everything works fine if using Stop / Start in Control Panel > Services > However if the service is already started and I select Restart, then it stops > the service but fails to start with > > error 1067: The process terminated unexpectedly. > > > Hs-err.pid file is created with OutOfMemoryError and: > > There is insufficient memory for the Java Runtime Environment to continue. > Native memory allocation (mmap) failed to map 21474836480 bytes for Failed to > commit area from 0x0000000300000000 to 0x0000000800000000 of length > 21474836480. > > If setting Xms and Xmx to 16Gb, it works. > If the pagefile size is increased to 32Gb, then it works also However we > should not need that pagefile as when Tomcat is stopped, only 2.5Gb out of > the 32Gb are used, and it works just fine if we do the 2 step process of Stop > and then Start. > > Using other application, Zookeeper, does not show this problem, the restart > works ok even when set to 20Gb, so it seems something with the Tomcat service > management. > > Any help will be appreciated > > Thank you > 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