Profiling a running Java application in command line

前端 未结 7 1215
被撕碎了的回忆
被撕碎了的回忆 2020-12-23 11:37

I profile running Java applications often with VisualVM but it needs X to run on the machine.

I know I can connect through management port but that will be an offlin

7条回答
  •  既然无缘
    2020-12-23 11:43

    We have used hprof on our servers and it definitely is better than sysouts in case you can't run a full fledged VisualVM session.

    Examples of using hprof are plenty out there:

    • http://www.javalobby.org/java/forums/t19612.html
    • https://coderwall.com/p/il3h4g/easy-profiling-java-from-command-line
    • http://www.brendangregg.com/blog/2014-06-09/java-cpu-sampling-using-hprof.html

提交回复
热议问题