Java application consuming native memory dependent on number of CPUs












0















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):



Grafana Comparison



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










share|improve this question























  • 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 '18 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 '18 at 17:06
















0















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):



Grafana Comparison



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










share|improve this question























  • 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 '18 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 '18 at 17:06














0












0








0








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):



Grafana Comparison



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










share|improve this question














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):



Grafana Comparison



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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 22 '18 at 15:59









Matthias MuthMatthias 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 at 17:06












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Create new schema in PostgreSQL using DBeaver

Deepest pit of an array with Javascript: test on Codility

Costa Masnaga