Skip to content
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

TLAB events create misleading flame graphs #10

Closed
oehme opened this issue Jan 11, 2018 · 5 comments · Fixed by #15
Closed

TLAB events create misleading flame graphs #10

oehme opened this issue Jan 11, 2018 · 5 comments · Fixed by #15
Labels

Comments

@oehme
Copy link
Contributor

oehme commented Jan 11, 2018

Using -e allocation-tlab seems to count the allocation events instead of counting the amount of memory allocated at that stack frame. This means that the flamegraph will show stacks that allocate often, even if they only allocate a few bytes.

As a user I'd expect the flamegraph to point me to the stacks that actually consumed the most memory.

@oehme
Copy link
Contributor Author

oehme commented Mar 22, 2018

Nevermind, the recording I looked at must have been bad. I tried with a few others and see actual memory usage being shown as expected.

@oehme oehme closed this as completed Mar 22, 2018
@oehme
Copy link
Contributor Author

oehme commented Mar 25, 2018

Okay I know now where the problem is. The converter currently reads the "allocationSize" field, which only contains the size of the object that triggered a new TLAB to be created. That doesn't tell you how much memory this type of object is taking up overall. The converter should use the "tlabSize" field instead.

@oehme oehme reopened this Mar 25, 2018
@chrishantha
Copy link
Owner

Hi @oehme, I'm really sorry for the delay. I will check on this soon and reply. I'm also happy to accept a PR if you can fix the code. 😄

@chrishantha chrishantha added the bug label May 3, 2018
@oehme
Copy link
Contributor Author

oehme commented May 3, 2018

You can take a look at my fork, it contains a couple of improvements:

  • tlab allocations now measure the tlabSize, the size is converted to kB
  • io and blocking are now measured by their duration instead of their count
  • the code for labeling and unit conversion is now in the EventType enum
  • the project is now built with Gradle so that there is a 1-step install process
  • broken stack frames no longer crash the tool

@chrishantha
Copy link
Owner

I checked your fork and saw all your improvements. (I actually saw your fork before your comment). Would you like to send a PR to my project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants