https://github.com/jcash/memprofile
A dynamic library for profiling allocations in an application
https://github.com/jcash/memprofile
Last synced: 9 months ago
JSON representation
A dynamic library for profiling allocations in an application
- Host: GitHub
- URL: https://github.com/jcash/memprofile
- Owner: JCash
- License: mit
- Created: 2018-01-20T15:55:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-10-06T21:01:46.000Z (almost 4 years ago)
- Last Synced: 2025-04-30T17:06:05.084Z (about 1 year ago)
- Language: C
- Size: 3.91 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# memprofile
A dynamic library for profiling allocations in an application
It does this by loading a library dynamically, without any need to instrument the application itself.
On MacOS:
$ DYLD_INSERT_LIBRARIES=libmemprofile.dylib ./a.out
On Linux
$ LD_PRELOAD=libmemprofile.dylib ./a.out
And the output will look like this:
$ DYLD_INSERT_LIBRARIES=libmemprofile.dylib ./a.out
Memory used:
Total: 512 bytes in 2 allocation(s)
At exit: 0 bytes in 0 allocation(s)
## Known issues:
Currently only tested on MacOS
Currently, in my examples, there's always an initial ``realloc`` call of 256 bytes.
I haven't traced the location of this call yet, please let me know if you know where it comes from :)