Can JProfiler measure stack depth?
Asked Answered
D

1

2

This is closely related to another question: How can I measure thread stack depth?

Can JProfiler watch threads and measure where the deepest stacks occur? If so, how can I do that? I'd like find spots in my application where I'm getting dangerously close to triggering a StackOverflowError.

Dorthadorthea answered 30/11, 2011 at 17:10 Comment(0)
P
1

JProfiler does not have this as a feature directly. However, you can do the following:

  • Record CPU data with sampling and no filters

  • go to the call tree view in the CPU section

  • export the call tree in XML format, selecting the "entire tree" option at the bottom of the file chooser dialog

  • write a small program that analyzes the exported XML file and finds the most deeply nested elements

You can also automate this with offline profiling and a trigger to record CPU data and save a snapshot. With the "jpexport" command line executable, you can then export the call tree from the saved snapshot.

Platelet answered 4/12, 2011 at 13:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.