README 767 B

12345678910111213141516171819202122232425262728
  1. * Size sample
  2. This sample provides a new internal call that can be used to
  3. obtain the size of an object and all of the referenced objects
  4. that this object holds.
  5. This is exposed in the method:
  6. int Mono.ObjectServices.ObjectInspector.GetMemoryUsage (object x)
  7. Available in the objectinspector.dll file; To use this, you
  8. must run Mono with the --profile=size argument (and have the
  9. libmono-profile-size.so module in your path).
  10. * Inner Details.
  11. This implementation used a profiler hook at jit-end to install
  12. a new internal call, and exposes a small DLL
  13. (objectinspector.dll).
  14. There is no need to use the profiler, the method body that
  15. does the object size computation can be copy/pasted elsewhere,
  16. particularly on embedded uses of Mono.