Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java eclipse IDE line speed debug

I have been working with java for a while and some programs I have made are terribly slow and parts of them run at abysmal speeds. I feel there should be a debug tool as an eclipse extension or as an existing feature that shows what lines or sections of the code are taking the longest to finish executing. Is there such a tool I could use, or is there a better way to check for optimization?

like image 575
Anthony Robertson Avatar asked Jan 28 '26 15:01

Anthony Robertson


1 Answers

+1 for measuring before optimization!

The default jvisualvm and its Sampler tab can easily pinpoint the bottlenecks for you.

jvisualvm is on the same path as javac, so you just type jvisualvm to the console, and it runs.

On the screenshot below you can see how I'm sampling eclipse. You can sample your own program too, just select the program on the Applications bar.

jvisualvm eclipse sampling

like image 79
Tamas Rev Avatar answered Jan 31 '26 05:01

Tamas Rev