User avatar
clicky
Posts: 512
Joined: Thu Oct 25, 2012 7:34 am

Java Profiling

Fri Jul 17, 2020 8:51 am

Just a quick reminder of wonderful Java profiling app made by Sun in the day: VisualVM

It is supplied with Debian:

Code: Select all

sudo apt-get install visualvm
and it works well with RPi...

You can do sampling of CPU or Memory, check for bottlenecks in your code and/or memory issues or leaks...

Also, for those who really like to be thorough with their testing - Eclipse has built in code coverage tool which nicely colours source code by if code has been executed (green), only some branches in code were hit (yellow) or not executed at all (red). No extra tinkering needed for the tool - just select run configuration through it (same as Run and Debug)...

BTW screenshots *are* from Raspberry Pi 4 running 64bit Raspberry Pi OS...
Attachments
VisualVM2.jpg
VisualVM2.jpg (215.6 KiB) Viewed 471 times
VisualVM1.jpg
VisualVM1.jpg (213.07 KiB) Viewed 471 times
EclipseProfiling.jpg
EclipseProfiling.jpg (168.2 KiB) Viewed 471 times

Return to “Java”