-
Notifications
You must be signed in to change notification settings - Fork 843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exposing simple UI action to open next segment of a heap dump #3518
Exposing simple UI action to open next segment of a heap dump #3518
Conversation
@@ -28,16 +28,19 @@ | |||
*/ | |||
class CacheDirectory { | |||
|
|||
private static final String DIR_EXT = ".hwcache"; // NOI18N | |||
private static final String DIR_EXT = ".nbcache"; // NOI18N |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is useful to avoid clash between Apache NetBeans profiler library and VisualVM profiler library. Both of these libraries are derived from NetBeans 8.2 profiler library, but evolve independently. Sharing the same directory leads to errors like:
java.io.IOException: Invalid HPROF version 3 loaded 2
at ...HprofHeap.<init>(HprofHeap.java)
at ...HeapFactory.loadHeap(HeapFactory.java)
at ...HeapFactory.createHeap(HeapFactory.java)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with me. Feel free to merge when review complete as long as before next Tues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me.
The Profiler native binary build-windows is repeatedly failing. Do you think it can be because of my changes? I have renamed the cached directory - that is the only (yet unlikely) thing which could cause the profiler binaries failures. |
Looks like it might have been failing for a while. It's only triggered rarely by path. Just done a manual trigger on master. And fails there too https://github.com/apache/netbeans/actions/runs/1762385602 |
I've created a simple library to generate
.hprof
files: HeapDump. It follows the Java Profiler Heap Dump Format specification, however it allows more than regular JVMs do. Regular JVMs always dump the whole heap in a single round, while the HeapDump allows one to generate multiple segments.There already is support for reading these multisegment files in the Apache NetBeans Profiler library - it just isn't exposed in the heapwalker UI. This PR fixes that. The fix isn't "fancy", but it does its job. When an additional segment is detected, there is a little link in the UI to open it in a new window.
Simple, but functional. I'd be delighted if the support for multisegment
.hprof
files landed in the NetBeans 13.