Who wants to have some fun memory debugging?

Denis Koroskin 2korden at gmail.com
Wed May 13 00:10:33 PDT 2009


On Wed, 13 May 2009 10:48:53 +0400, grauzone <none at example.net> wrote:

>> Maybe it's time to put together an instrumented GC...
>
> Wishlist:
> - some way to know _when_ a collection happened (or how often)
> - logging of allocations (module/linenumber of allocator, size of  
> allocation, type of allocation)
> - per TypeInfo allocation statistics
> - per module allocation statistics

At work, we manage memory ourselves (C++ that is). As result of a program run, a memory log is created which is then visualized by a Memory Monitor. MM gives a picture of memory state at any given time. You use a scroller to advance in time. You may a watch a history of every memory block - when it was first allocated, how it was reused, etc. It also gives you a great picture of how big memory fragmentation is, how efficient it is reused etc.

I may post a few screenshots or even a whole program with a sample memory log to show you how useful it is. Perhaps, it will be an inspiration for someone to create something like it for D GC.
Unfortunately, an implementation is heavily memory-management specific and thus there is little to no code to share.



More information about the Digitalmars-d-learn mailing list