TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Javaflame – Simple Flamegraph for your Java application

31 pointsby beothornover 1 year ago
Javaflame will generate a flamegraph of your application function calls, including the argument values and the return of each function.<p>Check <a href="https:&#x2F;&#x2F;beothorn.github.io&#x2F;javaflame" rel="nofollow noreferrer">https:&#x2F;&#x2F;beothorn.github.io&#x2F;javaflame</a> to see an example.<p>There are already some tools that render flamegraphs for java, but they are focused on measuring performance or require some other process running along with the application. They also record function calls, but do not record the arguments or return values from those functions.<p>I needed instead something to help understand and debug my applications that was better than adding breakpoints and slowly step over every call.<p>This is a simple java agent that renders a flamegraph on a html file, no extra dependencies or other processes involved. All you need is an extra argument passed to the JVM on the command line pointing to the java agent.<p>It calls toString on every parameter and return value of every function that is included on the filter, so I wouldn&#x27;t use this outside your dev machine.

3 comments

luzifer42over 1 year ago
Why reinvent the wheel? <a href="https:&#x2F;&#x2F;github.com&#x2F;async-profiler&#x2F;async-profiler#flame-graph-visualization">https:&#x2F;&#x2F;github.com&#x2F;async-profiler&#x2F;async-profiler#flame-graph...</a><p>Ok, Windows is not supported. But IntelliJ made a fork which works on Windows. <a href="https:&#x2F;&#x2F;packages.jetbrains.team&#x2F;maven&#x2F;p&#x2F;ij&#x2F;intellij-dependencies&#x2F;org&#x2F;jetbrains&#x2F;intellij&#x2F;deps&#x2F;async-profiler-windows&#x2F;2.1-ea-13&#x2F;async-profiler-windows-2.1-ea-13.jar" rel="nofollow noreferrer">https:&#x2F;&#x2F;packages.jetbrains.team&#x2F;maven&#x2F;p&#x2F;ij&#x2F;intellij-dependen...</a>
评论 #38221819 未加载
评论 #38217029 未加载
parttimenerdover 1 year ago
I wrote a small profiler in ~240 lines of pure Java code: <a href="https:&#x2F;&#x2F;github.com&#x2F;parttimenerd&#x2F;tiny-profiler">https:&#x2F;&#x2F;github.com&#x2F;parttimenerd&#x2F;tiny-profiler</a><p>It is reasonable fast :)
评论 #38220149 未加载
renewiltordover 1 year ago
Interesting. Usually I use a flamegraph for performance reasoning. How do you use this flamegraph?<p>Cool tool btw.
评论 #38193029 未加载