Is it possible to 'see' the object graph for garbage collection?

后端 未结 2 1417
傲寒
傲寒 2021-01-06 05:04

I have a Java application that is leaking memory. I know which objects are not being freed during garbage collection, but I can\'t work out what is referencing them.

2条回答
  •  臣服心动
    2021-01-06 05:14

    On a really basic level, you can use the commands jhat and jmap to read a heap file from a running Java process and then process it - it starts a small web server on a local port. It's not exactly easy to read, but you don't have to buy a profiler to use it.

提交回复
热议问题