You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.9 KiB

  1. This is a set of tools designed to help find memory leaks in
  2. programs, and to locate memory-hogging functions. It's implemented as
  3. a wrapper library that goes around malloc/free/etc, and an include file
  4. that "intercepts" calls to malloc/free/etc and makes them call the
  5. wrappers. Thus, you can get extensive memory profiling and leak
  6. detection by just adding one #include directive at the top of your
  7. file and recompiling/linking.
  8. Unlike some similar tools I've seen in the past, this makes
  9. sure that it keeps its on-disk data current, so that if the program
  10. is crashed or interrupted, the results still have some validity. The
  11. on-disk data is as compacted as I could make it, to give a chance of
  12. this being useable in debugging big memory pigs. It adds some cost
  13. in performance and memory size (since it keeps its own in-memory
  14. symbol tables) but since it's only a debugging tool, I think the
  15. cost is worth the benefit. This library can also be used to track
  16. only allocations in a single module, or set of modules, and doesn't
  17. interfere with calls to the "real" malloc() that are made in other
  18. library routines.
  19. Every effort has been made to ensure that the code is
  20. portable and won't interfere with running code - it should just
  21. plug in or out. The biggest hindrances are forward declarations of
  22. malloc() [which the preprocessor gleefully turns into syntax errors
  23. for you] and structure elements named "free". The code has been
  24. tested under Ultrix on DEC Risc and VAX systems, and under SunOS
  25. on a Motorola platform. Please send patches, suggestions, etc,
  26. to the author, who will probably not have time to do anything with
  27. them.
  28. Compiling and building:
  29. You may wish to edit the Makefile and glance at mnemconf.h,
  30. then simply type "make". "make mtest" will build a simple test program
  31. that will give you an idea of how things work. "make runmtest" will
  32. run the test and do analysis on it.
  33. Marcus J. Ranum
  34. mjr@decuac.dec.com