jbellis / jamm

Java Agent for Memory Measurements
Apache License 2.0
684 stars 125 forks source link

Support limited recursion depth on the debugging tree output #20

Closed Fentonator closed 9 years ago

Fentonator commented 9 years ago

Would be very nice if there was a way to set the maximum recursion depth of the tree generated by enableDebug(), for cases where it is being used as a "poor man's profiler" when dealing with objects that have a lot of collections or other object containers (and thus can end up having very large trees otherwise).

blerer commented 9 years ago

You can now specify the depth of the tree to be printed using enableDebug(int depth). If the tree is not fully printed the total size of the subtree will not be printed with each node as it does not make sense.