Re: java.lang.OutOfMemoryError: Metaspace while deploying application

2022-03-01 Thread Christopher Schultz

Nagarajan,

On 3/1/22 08:49, Rengaswamy, Nagarajan wrote:

Currently we are running 6 applications in Tomcat version 8.5.70

Our Linux Infra - memory size allocated like Entire memory 3GB, In
that 1.5 GB as Heap size and 512 is for XX:MaxMetaspaceSize.


The numbers above are confusing to me. If you have 1.5GiB heap and .5GiB 
metaspace then what is 3GiB? Please post your actual memory-related JVM 
launch options.



Java version as 11. No performance related issue while application
runs in peak load. But when we deploy the any one of the application
while running tomcat, first deploy get success and next deploy is
throwing like "Exception in thread "_Worker-3" 
java.lang.OutOfMemoryError: Metaspace"


Do you get this error when you deploy the application the first time, 
re-deploying an existing (already-deployed) application?



Based on our investigation, heap dump shows _3_ instances of the
ParallelWebappClassLoader consuming more memory which is causing this
issue.


I would expect that you would have 6 ParallelWebappClassLoader instances 
in the heap if you have 6 applications deployed. Are you saying that you 
have 6 + 3 "extra" instances of that class in the heap?


If so, you have a classloader-pinning leak in /your web application/ 
that must be fixed. Mark posted a presentation in reply that should be 
very helpful in diagnosing what's happening with your application.



Currently we are doing server restart before deploy as workaround
now.

Kindly suggest is there any open issue which needs to be addressed by
Apache Software Foundation? or provide solution to overcome this
issue.


This is likely to be a problem with your application, not Apache Tomcat.

-chris

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



Re: java.lang.OutOfMemoryError: Metaspace while deploying application

2022-03-01 Thread Mark Thomas

https://home.apache.org/~markt/presentations/2010-08-05-Memory-Leaks-JavaOne-60mins.pdf

Written for Java 7 but applies equally later versions of Tomcat.

Mark

On 01/03/2022 13:49, Rengaswamy, Nagarajan wrote:

Hi Team,

Currently we are running 6 applications in Tomcat version 8.5.70


Our Linux Infra - memory size allocated like Entire memory 3GB, In that 1.5 GB 
as Heap size and 512 is for XX:MaxMetaspaceSize. Java version as 11.
No performance related issue while application runs in peak load. But when we deploy the any one of the 
application while running tomcat, first deploy get success and next deploy is throwing like 
"Exception in thread "_Worker-3" java.lang.OutOfMemoryError: 
Metaspace"



Based on our investigation, heap dump shows _3_ instances of the 
ParallelWebappClassLoader consuming more memory which is causing this issue.

Currently we are doing server restart before deploy as workaround now.

Kindly suggest is there any open issue which needs to be addressed by Apache 
Software Foundation? or provide solution to overcome this issue.



Thanks!

Disclaimer

This e-mail message is being sent solely for use by the intended recipient(s) 
and may contain confidential information. Any unauthorized review, use, 
disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by phone or 
reply by e-mail, delete the original message and destroy all copies. Thank you.



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



RE: java.lang.OutOfMemoryError: Metaspace while deploying application

2022-03-01 Thread Rengaswamy, Nagarajan
Hi Team,

Currently we are running 6 applications in Tomcat version 8.5.70


Our Linux Infra - memory size allocated like Entire memory 3GB, In that 1.5 GB 
as Heap size and 512 is for XX:MaxMetaspaceSize. Java version as 11.
No performance related issue while application runs in peak load. But when we 
deploy the any one of the application while running tomcat, first deploy get 
success and next deploy is throwing like "Exception in thread 
"_Worker-3" java.lang.OutOfMemoryError: Metaspace"



Based on our investigation, heap dump shows _3_ instances of the 
ParallelWebappClassLoader consuming more memory which is causing this issue.

Currently we are doing server restart before deploy as workaround now.

Kindly suggest is there any open issue which needs to be addressed by Apache 
Software Foundation? or provide solution to overcome this issue.



Thanks!

Disclaimer

This e-mail message is being sent solely for use by the intended recipient(s) 
and may contain confidential information. Any unauthorized review, use, 
disclosure or distribution is prohibited. 
If you are not the intended recipient, please contact the sender by phone or 
reply by e-mail, delete the original message and destroy all copies. Thank you.