GCP calls OOMKiller for java app however it doesn t consume max allowed memory

0 votes
Input: GCP, Kubernetes, java 11 spring boot 2 application

Container is started with memory limit 1.6GB. Java application is limiting memory as well -XX:MaxRAMPercentage=80.0. Under a "heavy" (not really) load - about 1 http request per 100 ms during about 4 hours application is killed by OOMKiller. Internal diagnostic tools is showing that memory is far from limit: POD contains only java app (+jaeger agent). The odd thing that after restart GCP shows almost maximum memory usage instead of slowly growing if it was memory leak.
Apr 6, 2022 in GCP by Rahul
• 3,380 points
669 views

1 answer to this question.

0 votes

As per the log file there are more than 10,000 started threads. This is a lot considering that there are 2CPU/core for each container. Each thread and its stack is allocated in memory separate from the heap. It is quite possible that the large number of started threads is the cause for the OOM problem.

The JVM is started with Native Memory Tracking related options

(-XX:NativeMemoryTracking=detail, -XX:+UnlockDiagnosticVMOptions, -XX:+PrintNMTStatistics)

that could help to see the memory usage include what's consumed by those threads. I would highly recommend to not have that many threads.

answered Apr 6, 2022 by Korak
• 5,820 points

Related Questions In GCP

0 votes
1 answer

Default session timeout for a java app engine

Default session timeout is set to 30 ...READ MORE

answered Sep 25, 2019 in GCP by Sirajul
• 59,230 points
2,049 views
0 votes
1 answer
0 votes
0 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Creating password for a windows instance on GCP

Windows Server instances use password authentication instead ...READ MORE

answered Sep 24, 2019 in GCP by Sirajul
• 59,230 points
4,331 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

GCP - Initate a shutdown to an instance after certein time when it started (for example 3 hours after started)

You can add the contents of a ...READ MORE

answered Mar 31, 2022 in GCP by Korak
• 5,820 points
907 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP