1

I want to check the backends' healthy condition, I use the ThreadPool start a Thread to check backend per10s. In this times, this will query mysql 6 times per 10s and not use the database connection pool. When I deploy this app in the cloud platform, I received message that the usage of memory is continued growth.

enter image description here

At first, I use the top command to watch the usage of Java Heap. In this picture, I find this app use about 3.2GB memory.

enter image description here

And then I exec the jmap -heap 9,but i find the heap usage of memory is only 1053MB.

enter image description here

I guess the reason of this is the number of thread. I exec the pstree -p | grep java | wc -l. I find only 70 threads.

enter image description here

Finally, I exec the jcmd 9 VM.native_memory scale=MB. I see the Heap usage of memory is 4096MB. This confused me. enter image description here

I want to decrease the usage of memory in this app. But I don't know how to solve it.

Amir_P
  • 8,322
  • 5
  • 43
  • 92
Felix.
  • 19
  • 2
  • 4
    There are a multitude of profiling tools designed specifically to help for things like this. JProfiler is the one I can remember off the top of my head, but I'm certain there are others. You could also remote debug/just plain debug it to get a better look at what's going on internally. – BeUndead Sep 11 '20 at 09:00
  • tx~, I try it right now – Felix. Sep 11 '20 at 09:04

0 Answers0