What is a good java debugger?

I am trying to find memory leaks and performance issues with my java application. Is there a program there that can help me debug my application and display the results of work?

Thanks.

+4
source share
4 answers

Look at jvisualvm in the JDK - a subset of the Netbeans profiler that can connect to a running Java 6 process and allow it to profile and analyze memory.

https://visualvm.dev.java.net/gettingstarted.html

+4
source

I used many tools to find out why my program eats 100 MB of RAM, polished the code to remove any possible memory leaks. Later, I discovered that as soon as jvm took some memory from the OS, I do not always return it, even if this memory is not used, which often looks like a memory leak. It depends on -Xmx and -XX: MaxHeapFreeRatio. I set Xmx to 40, which is approximately equal to how much memory my application should use, and memory usage remains within 10-15 MB of this range, and not increase uncontrollably.

In addition, jconsole is a great tool. It comes with jdk.

+1
source

Eclipse has a good memory dump analyzer; but detecting a memory leak can be a very difficult task and requires a deep dive into the way objects are allocated by your application.

It took me 2 full days to find out that one of my custom cell classes of the JTable class allocated JDialog when creating an instance, without actually opening it, and its own part of the dialog kept the cell block instance locked, thus the table, thus the screen and, therefore, all objects of the object that were associated with it.

0
source

You can try the performance test tool. The following is the url.

http://perfinsp.sourceforge.net/

The performance of Java applications is directly proportional to how the JVM launches your application. This tool provides very good profiling information about the JVM. But this is not a graphic tool, you need to go through the created text file. But his one-time effort, and you can come in handy with this tool. I used it a lot of time for performance issues, and it helped me a lot.

0
source

All Articles