Postmortem Memory Profiling with Perl
Irish writes "Problems with memory, such as leaks and memory-greedy applications can cause many problems for application developers; more so for wireless applications due to the prevalence of memory-constrained devices as platforms. This article shows you how to avoid memory problems and it shows how to use Perl script to analyze memory issues for later repair. It offers three progressively more sophisticated solutions to demonstrate the concept."
When you die, the coroner can now attach a Perl program to your brain and find out what you were thinking.
CSI is going to be very boring now.
Using Perl to fix memory problems.
include $sig;
1;
But what is the big deal here?
... could be achieved in C by replacing the allocate calls with a macro that inserts the filename and line number. Alternatively, add a parameter (string/number) to the allocate function and then preprocess the source with an external tool (PERL script, for example) that puts a unique value in each call to a memory function.
We've had this kind of memory leak tracing for ages (simple C++ macro's to wrap around 'new' and 'delete' is one example)
Ok, so we're doing it externally with perl now, yay.
And by the way:
If you need to edit the source, then why use an external script in the first place?
The path I walk alone is endlessly long.
30 minutes by bike, 15 by bus.
The author has reinvented the wheel. Any debug heap that provides a trace can do this, so this is basically an old hat.t rol_83 .html provides a very good list of resources for debug heaps.
http://www.cbmamiga.demon.co.uk/mpatrol/mpa
We know from the article title that the author is not adept with Perl. The language is "Perl", the interpreter is "perl", and there is no PERL. The camel and llama books make this *very* evident.
I thought this would help me track memory in my Perl programs. I've got plenty of tools for C/C++, thanks.....
of course I admit that if I really cared about memory I wouldn't use perl, but sometimes you get stuck with things!