JVM large object troubleshooting

View Java objects that take up more memory in the Linux environment

 

  1. Use top to view the top java processes
  2. View the top 30 java objects that take up more memory jmap -histo:live [pid] | head -30, or export to a file:

      jmap -dump:format=b,file=/filepath/heap.bin pid 

 

Note: If the current user is not the user who started the java process, using the jmap command will report the following error: well-known file is not secure

Use su to switch to the java user and then execute;

View all users under the root user:
cat /etc/passwd

If there are many system classes in the query result, you can use the grep command to further filter out the objects in the business:

E.g:

jmap -histo:live 54968 |grep com.XXX| head -30

jmap -dump:format=b,file=/filepath/heap.bin pid 

jmap -histo 54968|grep com.XXX |sort -k 2 -g -r|less

Guess you like

Origin blog.csdn.net/qq_36807862/article/details/100777103