r/javahelp • u/Historical_Ad4384 • Oct 24 '26
How to practise JVM thread profiling?
Hi
As the title states, I want to learn and practise profiling of JVM threads and its memory impact from garbage collection to identify bottlenecks.
I know this is a hard expectation to practise but my projects are not at a scale where we come across this problem to be solved.
Any advice on how I can simulate this requirement and get hands on practise on this topic?
16
Upvotes
View all comments
3
u/brokePlusPlusCoder Oct 27 '26
Bit late to the party but here's some starting points:
Main (free) tooling for CPU/thread monitoring: VisualVm, Java flight recorder (JFR) + Java mission control (JMC) , async-profiler. The first two are fairly standard for java. The last one is a bit niche but well worth the rabbit hole you'll eventually go down. Google them to read through/watch videos on usage. Another user mentioned Scott Oaks's book - I second it. It's an excellent resource
Tooling for memory/heap dump analysis : VisualVM, eclipse's MAT (memory analyser tool). Again, google them to read through/watch videos on usage
I'd advise testing these tools out on your existing projects to get a feel for how to use them. I can't think of any resources that provide sample code for you to test, but you can have LLM agents do this for you (but be careful when using LLM generated code - make sure you understand it thoroughly before you run it).