Java application consuming native memory dependent on number of CPUs
up vote
0
down vote
favorite
I have a dockerized Java Application running in a Kubernetes cluster. Till now I have had configured a CPU limit of 1.5 cores. Now I increased the available CPUs to 3 to make my app perform better.
Unfortunately it needs significantly more Memory now and gets OOMKilled by Kubernetes. This graph shows a direct comparison of the overall memory consumption of the container for 1.5 cores (green) and 3 cores (yellow) (nothing different but the CPU limits):
The Java Heap is always looking good and seems not to be a problem. The memory consumption is in the native memory.
My application is implemented with Spring Boot 1.5.15.RELEASE, Hibernate 5.2.17.FINAL, Flyway, Tomcat. I compile with Java 8 and start it with a Docker OpenJDK 10 container.
I debugged a lot the last days using JProfiler and jmealloc as described in this post about native memory leak detection. JMEalloc told me about a large amount of Java.util.zipInflater.
Has anyone any clue what could explain the (for me very irrational) coupling of available CPUs to native memory consumption?
Any hints would be appreciated :-)!
Thanks & Regards
Matthias
java hibernate spring-boot memory-leaks kubernetes
add a comment |
up vote
0
down vote
favorite
I have a dockerized Java Application running in a Kubernetes cluster. Till now I have had configured a CPU limit of 1.5 cores. Now I increased the available CPUs to 3 to make my app perform better.
Unfortunately it needs significantly more Memory now and gets OOMKilled by Kubernetes. This graph shows a direct comparison of the overall memory consumption of the container for 1.5 cores (green) and 3 cores (yellow) (nothing different but the CPU limits):
The Java Heap is always looking good and seems not to be a problem. The memory consumption is in the native memory.
My application is implemented with Spring Boot 1.5.15.RELEASE, Hibernate 5.2.17.FINAL, Flyway, Tomcat. I compile with Java 8 and start it with a Docker OpenJDK 10 container.
I debugged a lot the last days using JProfiler and jmealloc as described in this post about native memory leak detection. JMEalloc told me about a large amount of Java.util.zipInflater.
Has anyone any clue what could explain the (for me very irrational) coupling of available CPUs to native memory consumption?
Any hints would be appreciated :-)!
Thanks & Regards
Matthias
java hibernate spring-boot memory-leaks kubernetes
I can't think of anything in Spring Boot that would link native memory usage to the number of available CPUs. However, please be aware that Spring Boot 1.5 does not support Java 10. The latest version of Java support by Boot 1.5 is Java 8. It's also worth noting that Java 10 is no longer supported. If you want to use a version of Java beyond 8, I would recommend using Java 11 with Spring Boot 2.1.
– Andy Wilkinson
Nov 22 at 16:30
As far i remember, if you dont set the springboot memory, he uses de JVM limit. Your graph is basic the java using all free memory in Eden Space, when get full, GC come and free the memory. I would recommend to set the memory limits and let the JVM deal with.
– cvdr
Nov 22 at 17:06
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a dockerized Java Application running in a Kubernetes cluster. Till now I have had configured a CPU limit of 1.5 cores. Now I increased the available CPUs to 3 to make my app perform better.
Unfortunately it needs significantly more Memory now and gets OOMKilled by Kubernetes. This graph shows a direct comparison of the overall memory consumption of the container for 1.5 cores (green) and 3 cores (yellow) (nothing different but the CPU limits):
The Java Heap is always looking good and seems not to be a problem. The memory consumption is in the native memory.
My application is implemented with Spring Boot 1.5.15.RELEASE, Hibernate 5.2.17.FINAL, Flyway, Tomcat. I compile with Java 8 and start it with a Docker OpenJDK 10 container.
I debugged a lot the last days using JProfiler and jmealloc as described in this post about native memory leak detection. JMEalloc told me about a large amount of Java.util.zipInflater.
Has anyone any clue what could explain the (for me very irrational) coupling of available CPUs to native memory consumption?
Any hints would be appreciated :-)!
Thanks & Regards
Matthias
java hibernate spring-boot memory-leaks kubernetes
I have a dockerized Java Application running in a Kubernetes cluster. Till now I have had configured a CPU limit of 1.5 cores. Now I increased the available CPUs to 3 to make my app perform better.
Unfortunately it needs significantly more Memory now and gets OOMKilled by Kubernetes. This graph shows a direct comparison of the overall memory consumption of the container for 1.5 cores (green) and 3 cores (yellow) (nothing different but the CPU limits):
The Java Heap is always looking good and seems not to be a problem. The memory consumption is in the native memory.
My application is implemented with Spring Boot 1.5.15.RELEASE, Hibernate 5.2.17.FINAL, Flyway, Tomcat. I compile with Java 8 and start it with a Docker OpenJDK 10 container.
I debugged a lot the last days using JProfiler and jmealloc as described in this post about native memory leak detection. JMEalloc told me about a large amount of Java.util.zipInflater.
Has anyone any clue what could explain the (for me very irrational) coupling of available CPUs to native memory consumption?
Any hints would be appreciated :-)!
Thanks & Regards
Matthias
java hibernate spring-boot memory-leaks kubernetes
java hibernate spring-boot memory-leaks kubernetes
asked Nov 22 at 15:59
Matthias Muth
11113
11113
I can't think of anything in Spring Boot that would link native memory usage to the number of available CPUs. However, please be aware that Spring Boot 1.5 does not support Java 10. The latest version of Java support by Boot 1.5 is Java 8. It's also worth noting that Java 10 is no longer supported. If you want to use a version of Java beyond 8, I would recommend using Java 11 with Spring Boot 2.1.
– Andy Wilkinson
Nov 22 at 16:30
As far i remember, if you dont set the springboot memory, he uses de JVM limit. Your graph is basic the java using all free memory in Eden Space, when get full, GC come and free the memory. I would recommend to set the memory limits and let the JVM deal with.
– cvdr
Nov 22 at 17:06
add a comment |
I can't think of anything in Spring Boot that would link native memory usage to the number of available CPUs. However, please be aware that Spring Boot 1.5 does not support Java 10. The latest version of Java support by Boot 1.5 is Java 8. It's also worth noting that Java 10 is no longer supported. If you want to use a version of Java beyond 8, I would recommend using Java 11 with Spring Boot 2.1.
– Andy Wilkinson
Nov 22 at 16:30
As far i remember, if you dont set the springboot memory, he uses de JVM limit. Your graph is basic the java using all free memory in Eden Space, when get full, GC come and free the memory. I would recommend to set the memory limits and let the JVM deal with.
– cvdr
Nov 22 at 17:06
I can't think of anything in Spring Boot that would link native memory usage to the number of available CPUs. However, please be aware that Spring Boot 1.5 does not support Java 10. The latest version of Java support by Boot 1.5 is Java 8. It's also worth noting that Java 10 is no longer supported. If you want to use a version of Java beyond 8, I would recommend using Java 11 with Spring Boot 2.1.
– Andy Wilkinson
Nov 22 at 16:30
I can't think of anything in Spring Boot that would link native memory usage to the number of available CPUs. However, please be aware that Spring Boot 1.5 does not support Java 10. The latest version of Java support by Boot 1.5 is Java 8. It's also worth noting that Java 10 is no longer supported. If you want to use a version of Java beyond 8, I would recommend using Java 11 with Spring Boot 2.1.
– Andy Wilkinson
Nov 22 at 16:30
As far i remember, if you dont set the springboot memory, he uses de JVM limit. Your graph is basic the java using all free memory in Eden Space, when get full, GC come and free the memory. I would recommend to set the memory limits and let the JVM deal with.
– cvdr
Nov 22 at 17:06
As far i remember, if you dont set the springboot memory, he uses de JVM limit. Your graph is basic the java using all free memory in Eden Space, when get full, GC come and free the memory. I would recommend to set the memory limits and let the JVM deal with.
– cvdr
Nov 22 at 17:06
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53434597%2fjava-application-consuming-native-memory-dependent-on-number-of-cpus%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I can't think of anything in Spring Boot that would link native memory usage to the number of available CPUs. However, please be aware that Spring Boot 1.5 does not support Java 10. The latest version of Java support by Boot 1.5 is Java 8. It's also worth noting that Java 10 is no longer supported. If you want to use a version of Java beyond 8, I would recommend using Java 11 with Spring Boot 2.1.
– Andy Wilkinson
Nov 22 at 16:30
As far i remember, if you dont set the springboot memory, he uses de JVM limit. Your graph is basic the java using all free memory in Eden Space, when get full, GC come and free the memory. I would recommend to set the memory limits and let the JVM deal with.
– cvdr
Nov 22 at 17:06