Mike Hommey: Logging Firefox memory allocations |
A couple years ago, when I was actively working on integrating jemalloc 3 in the Firefox build, and started investigating some memory usage regression compared to our old fork, I came up with a replace-malloc library for Firefox that would log all the allocations, and allow to replay them in a more consistent (and faster) way in a separate program, such that testing different configurations of jemalloc with the same workload can be streamlined.
A couple weeks ago, I refreshed that work, and made it work on all the tier-1 Firefox desktop platforms. That work is now in the tree instead of on my hard drive, and will allow us to test the effects of jemalloc changes in a better way.
The bulk of how to use this feature is the following:
LD_PRELOAD=/path/to/memory/replace/logalloc/liblogalloc.so
DYLD_INSERT_LIBRARIES=/path/to/memory/replace/logalloc/liblogalloc.dylib
MOZ_REPLACE_MALLOC_LIB=/path/to/memory/replace/logalloc/logalloc.dll
MALLOC_LOG=/path/to/log-file
python /source/path/to/memory/replace/logalloc/replay/logalloc_munge.py < /path/to/log-file > /path/to/replay.log
/path/to/memory/replace/logalloc/replay/logalloc-replay < /path/to/replay.log
More information and implementation details can be found in the README accompanying the code for that functionality.
Комментировать | « Пред. запись — К дневнику — След. запись » | Страницы: [1] [Новые] |