Objprof for HHVM (Approx. instance counter)
Summary: A lot of times something happens and suddenly PHP land OOMs with bad requests spiking.
Today we record allocations stats and post them with every requests for triaging.
Once we know an endpoint has gone bad, there's still a lot of unknown as to what have happened (Every endpoint has a very large code base).
Objprof for HHVM is an extension that attempts to get approximation of instance count per class.
The extension will be triggered periodically and also upon memory outliers.
Using a comparison view of baseline vs. bad behavior should expose interesting aspects as to what takes the memory.
It isn't a lot of code. There are 3 phases to do it-
1. Map all the Class* known to HHVM
2. Traverse the slabs and increment for every valid Class*
3. Dump all mapped Class* with at least 1 instance back to PHP
Reviewed By: @markw65
Differential Revision:
D1528183