java search for `closable` objects, where close was not called

70 Views Asked by At

Look like I have memory leak in project, and I was able to find 2 methods, where closable resources were created, but close method was never called.

Is it possible to scan project, to find resources without close method call?

Anybody use lints for such purposes? Any suggestions may help. Thx.

1

There are 1 best solutions below

0
Gevorg Harutyunyan On

For identifying a memory leak you can enable verbose garbage collection in your JVM configuration(-verbose:gc). Which is showing detailed information about your GC. Summary reports are shown in the default error file, it will help you to understand how your memory is used. And from that reports you might guess such issues.