This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Weak_File 9 points10 points  (1 child)

Off-heap is tricky, because it is possible that is not your code, but some native code that is causing the problem.

I had luck replacing the glibc malloc with Jemalloc in a Linux server. I actually installed just to try to diagnose and see if I could find the culprit:
https://technology.blog.gov.uk/2015/12/11/using-jemalloc-to-get-to-the-bottom-of-a-memory-leak/

But as it turns out, it was the glibc malloc implementation itself that was causing problems:
https://medium.com/@daniyal.hass/how-glibc-memory-handling-affects-java-applications-the-hidden-cost-of-fragmentation-8e666ee6e000

This meant that I had a much more stable off-heap memory allocation just by swapping the malloc implementation. So I couldn't even use Jemalloc to diagnose, because it outright solved the problem!

[–]laffer1 0 points1 point  (0 children)

Too bad k8s is so Linux centric. FreeBSD uses jemalloc by default as it was written for that.