Question: How to diagnose memory-allocation errors

I have a code that is built on a module which in turn contains records, procs etc. to model certain electronic devices.

The main program first instantiates the various circuits I am using. These are mostly Maple records. It then enters a loop that iterates over a number of cycles this system executes in order to build up statistics.

My problem is that somewhere the code has a memory leak, and Maple eats up rather vast amounts of memory, that increase with the number of cycles in the loop. I suspect that some of the methods I am calling allocate a new instance on each cycle, which is not the intended behaviour. What I am looking for is a way to diagnose e.g. which record, or which proc, gets allocated anew every time. I know about usage but that prints out only the amount of memory allocated; that does not help; I know the number is large. I am looking for a tool that e.g. tells me that record xx is allocated 1000 times etc.

Thanks,

M.D.

Please Wait...