Skip to content

A dynamic library for profiling allocations in an application

License

Notifications You must be signed in to change notification settings

JCash/memprofile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 :)

About

A dynamic library for profiling allocations in an application

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published