-1

It is being a lot of hour re-searching and try find wth is calling a unsafe.allocateMemory and no success at all. Kind of disappointed :-( Im not a expert or profile or with jemalloc but here is what I did so far and hopefully someone can see/find what I could not...

  • Heap and non-Heap memory are all good...I used yourkit.
  • General memory on the box increase crazily until 100% and the jvm crash.
  • Using Jemalloc and let the app run for a lot of time I was able to get some JEPROF files and converted some of them into PDF to see the memo/function stack calls: enter image description here

I see that something is calling the unsafe.allocateMemory and not calling the unsafe.freeMemory after done, so it will eat all my memory. I did a thread dump from the application (link to the txt with the thread dump) but unfortunately I was not able to find anything related to the unsafe.allocateMemory. Can anyone see something that I was not able to see or helping me by giving me any clue or pointing me in the right direction ? Thank you....

usphisics
  • 131
  • 1
  • 6

1 Answers1

1

Try async-profiler. It can show you complete Java stack traces of all callers of Unsafe_AllocateMemory0.

Example:

./profiler.sh -e Unsafe_AllocateMemory0 -f alloc.html <pid>

The output file alloc.html will be a flame graph of all Unsafe_AllocateMemory0 calls:

alloc.html

For more information about finding native memory leaks in Java, see this question and this discussion.

apangin
  • 92,924
  • 10
  • 193
  • 247