How to Profile JVM memory in the code?

后端 未结 5 1769
既然无缘
既然无缘 2021-01-03 09:24

I am writing a servlet that I can\'t test in Eclipse, I need to run on server. I want to do memory profiling and pinpoint any leaks. So, I think I need write debug statement

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-03 10:13

    Profiling application memory and hunting down leaks would be a difficult task, not to mention misleading with simple debug statements. If you can't use a tool which remotely connects to your process, using hprof would be a good bet IMO. Also, have a look at the troubleshooting documentation here.

    But I still think it would be better if you tried to do the same locally (i.e. fixing leaks) if possible.

提交回复
热议问题