Debugging performance issues in production can be a pain and in some cases impossible without the right tools. Java profilers have been around forever, but the profilers most developers think about are only one type – there are actually three:
Standard JVM Profilers
A standard Java profiler certainly provides the most data, but not necessarily the most usable information. This depends on the type of debugging task. These profilers will track all method calls and memory usage which allows a developer to dive into the call structure at whatever angle they choose.
Lightweight Java Transaction Profilers
Lightweight profilers take a different approach at tracking your application by injecting themselves right into the code. Aspect Profilers use aspect-oriented programming (AOP) to inject code into the start and end of specified methods. Java Agent profilers use the Java Instrumentation API to inject code into your application.
Low Overhead, Java JVM Profiling in Production (APM)
All the profilers so far have been great for development, but tracking how your system performs in production is critical. Production is always a different landscape – development and staging setups typically don’t have the same datasets and load.
Java APM tools typically use the Java Agent profiler method but with different instrumentation rules to allow them to run without affecting production performance. The trick with these profilers is to provide the right information in a smart way to not take up CPU cycles.
Why Are Some Java Profilers So Expensive?
XRebel is a cool tool, but it costs $365 a year. Stackify Prefix is free and provides much of the same functionality.
The biggest problem with APM solutions is definitely their pricing. They have traditionally been so expensive that only the largest enterprises could afford them. It doesn’t make a lot of sense to spend $100 a month on a server at Azure or AWS and then spend another $200 a month for a product like New Relic.
Monitoring tools shouldn’t cost more than the servers! Both Prefix and Retrace have profiling functionality and are incredibly affordable. Prefix is free for life and Retrace is free for the first two weeks.
Applications to manage Java profilers and other Java tools, books, websites and blogs, YouTube channels, podcasts, events, and LinkedIn can be found in our Comprehensive Java Developer’s Guide. Download it for free now:
If you would like to be a guest contributor to the Stackify blog please reach out to [email protected]