Skip to content

Filter native frames in allocation profile #993

Closed
@apangin

Description

@apangin

Describe the feature

Just like CPU profile, allocation profile should have native frames visible by default.
However, we should avoid littering flame graphs with meaningless frames of the profiler itself along with JVM internal frames repeated in every single stack trace.

Use Case

Objects are not always allocated in Java code; sometimes they are allocated inside the JVM runtime. It will be useful to see such stacks on a flame graph.

Today, if we add cstack option, allocation stack traces will include native frames, however, flame graph will become too noisy:
alloc-old
All these yellow frames on the above picture make no sense. We should only include native frames when they are really needed to distinguish JVM allocations from Java allocations:
alloc-new

Proposed Solution

  1. Enable native stack traces in allocation profiles by default.
  2. Remove all native frames belonging to the common allocation path in the JVM and to async-profiler itself.
  3. Do not show native stack traces for contended lock events.

Example:
alloc-good

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions