facebook / hhvm

A virtual machine for executing programs written in Hack.
https://hhvm.com
Other
18.14k stars 2.99k forks source link

Heapgraph sampling and visualization tooling #8623

Open andrewjtimmons opened 4 years ago

andrewjtimmons commented 4 years ago

HHVM Version

hhvm --version HipHop VM 4.13.2 (rel)

hh_client --version hackc-a6fd900a34a498abea492c9bcb9045ee5e9cb7f3-4.13.2

Heapgraph visualization and sampling

It would be great to have tooling that could sample a heapgraph and then output data and stacks that could be visualized in an icicle format, similar to an inverted flamegraph created by Xenon. I spoke with Kendall Hopkins and he suggested tooling and visualizations might exist.

https://github.com/facebook/hhvm/tree/master/hphp/runtime/ext/objprof

fredemmott commented 4 years ago

@KendallHopkins what tools were you thinking of, and what would be involved in releasing them?

fredemmott commented 4 years ago

fb T58748336

andrewjtimmons commented 4 years ago

Good afternoon @fredemmott and @KendallHopkins. I was wondering if there is a status update for this?

fredemmott commented 4 years ago

Pinged on internal task.

fredemmott commented 4 years ago

For FB reference: MnemonicProfiler + Heapgraph + HeapgraphUtils should be releasable.

Current problem is what other work to drop to get those released.

andrewjtimmons commented 4 years ago

Thank you Fred!

Do you have any estimates on when this might be ready? We would love to have more insight into our memory usage.

fredemmott commented 4 years ago

Sorry, no; there's currently no clearly lower-priority work to drop to provide time to work on this; it'll be brought up as part of our planning for the next 6 months along with the other things that we weren't able to get to this half.

fredemmott commented 4 years ago

We're unlikely to be able to release these tools this year; that said, I'll dedicate a few days to investigation, and share what I can. This is more likely to be information than runnable tools.

andrewjtimmons commented 4 years ago

Thank you Fred, we appreciate you taking the time to look at this and share some info.

If you also have pointers on this https://github.com/facebook/hhvm/issues/8622, specifically what it might take to get some var names in obj prof that would go a long way. If we could run objprof when we OOM and even just get the top 5 or 10 memory consuming user defined vars logged it would be a huge help for debugging.