Skip to content

Conversation

@dwnusbaum
Copy link
Contributor

@dwnusbaum dwnusbaum commented Sep 10, 2025

  • aragozin/jvm-tools@0f9fcb9 is needed for Java 10+ string support. It first landed in version 0.11 of hprof-heap, but the maintainer later split the library out into a separate repository, see https://github.com/aragozin/heaplib, so this PR swaps to the new artifact. I have been running this for years but forgot to file a PR for it.
  • FlowExecutionList.Storage jenkinsci/workflow-api-plugin#370 broke this script. I added support for DefaultStorage in this PR
  • I added Hex-encoded output for easier use with tools like Eclipse MAT and started printing the address of the objects used to find the WorkflowRun to make things easier to link in cases where CpsFlowExecution.cleanUpHeap has already run

Known issues:

Exception in thread "main" org.netbeans.lib.profiler.heap.HeapOffsetMap$PageNotFoundEndOfHeapReachedExcpetion: No such ID, end of heap reached
	at org.netbeans.lib.profiler.heap.HeapOffsetMap.scanPage(HeapOffsetMap.java:208)
	at org.netbeans.lib.profiler.heap.HeapOffsetMap.offsetForCompressed(HeapOffsetMap.java:113)
	at org.netbeans.lib.profiler.heap.HeapOffsetMap.offset(HeapOffsetMap.java:79)
	at org.netbeans.lib.profiler.heap.FastHprofHeap.idToDumpOffset(FastHprofHeap.java:98)
	at org.netbeans.lib.profiler.heap.FastHprofHeap.getInstanceByID(FastHprofHeap.java:124)
	at org.netbeans.lib.profiler.heap.HprofInstanceObjectValue.getInstance(HprofInstanceObjectValue.java:37)
	at org.gridkit.jvmtool.heapdump.FieldStep.walk(FieldStep.java:44)
	at org.gridkit.jvmtool.heapdump.HeapWalker.collect(HeapWalker.java:508)
	at org.gridkit.jvmtool.heapdump.HeapWalker.valueOf(HeapWalker.java:222)
	at Main.main(Main.java:41)

@rkivisto
Copy link

I have tested this fix, and it resolves the issues I was encountering with the actual Pipeline job names not being printed correctly when analyzing a heap dump from openjdk 11.0.24:
OpenJDK 64-Bit Server VM (Red_Hat-11.0.24.0.8-2) (build 11.0.24+8-LTS, mixed mode, sharing)

@dwnusbaum dwnusbaum changed the title Update to standalone heaplib dependency to fix issues with Java 10+ strings Various fixes and improvements for recent Java and Jenkins versions Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants