How can I stop scanning TLD's?

2022-04-12 Thread Blake McBride
Greetings,

When booting my app, the system takes a long time to get past:

12-Apr-2022 20:21:18.648 INFO [main]
org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned
for TLDs yet contained no TLDs. Enable debug logging for this logger for a
complete list of JARs that were scanned but no TLDs were found in them.
Skipping unneeded JARs during scanning can improve startup time and JSP
compilation time.
12-Apr-2022 20:21:18.694 INFO [main]
org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web
application directory [/home/arahant/tomcat/webapps/host-manager] has
finished in [277] ms
12-Apr-2022 20:21:18.695 INFO [main]
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory [/home/arahant/tomcat/webapps/arahant]
Apr 12, 2022 8:21:20 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable
debug logging for this logger for a complete list of JARs that were scanned
but no TLDs were found in them. Skipping unneeded JARs during scanning can
improve startup time and JSP compilation time.

I guess it is scanning for TLD's.  I'm not completely sure what that is but
if possible, I'd like to bypass that step as much as possible.

Some facts:

64-bit Linux
Apache Tomcat/9.0.62
Java 8

My app is pretty large - about 10,000 classes and over 100 jar files.  I
suppose scanning all of those files is what is taking so long.

My app is dumb html and javascript files that communicate via SOAP and
REST.  There is no JSP.

Thanks for the help!

Blake McBride


RE: Tomcat service does not restart on Windows with high value of Xms/Xmx

2022-04-12 Thread Morfin, Christophe
Hi

Thank you

I do have the same behaviour if I set Xms/Xmx in the Java Option or if I set 
the Initial and Maximum memory pool (I removed Xms/Xmx from Java Option for 
that test)
I really think it would be interesting if you could test on a Win 2019 with 
32Gb of RAM as  I would think you should be able to reproduce since I have had 
several reports of this issue now.

Thank you
Kind regards
Christophe



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: 12 April 2022 11:26
To: 'users@tomcat.apache.org' 
Subject: RE: Tomcat service does not restart on Windows with high value of 
Xms/Xmx

Hi

As additional information I have done further testing

Windows 2016 32Gb RAM
Xms/Xmx 20g
Pagefile 5g

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.

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' 
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' 
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 0x, 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 

Re: Tomcat service does not restart on Windows with high value of Xms/Xmx

2022-04-12 Thread Suvendu Sekhar Mondal
Hello Christophe,

On Tue, Apr 12, 2022 at 3:56 PM Morfin, Christophe  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' 
> 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' 
> 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 0x, 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:
>
> 

RE: Tomcat service does not restart on Windows with high value of Xms/Xmx

2022-04-12 Thread Morfin, Christophe
Hi

As additional information I have done further testing

Windows 2016 32Gb RAM
Xms/Xmx 20g
Pagefile 5g

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.

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' 
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' 
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 0x, 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 0x0003 to 0x0008 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