[fpc-pascal] Is such memory statistics possible?

Max Vlasov max.vlasov at gmail.com
Mon Aug 15 11:51:15 CEST 2011


On Mon, Aug 15, 2011 at 1:03 PM, Marco van de Voort <marcov at stack.nl> wrote:

> In our previous episode, Max Vlasov said:
> > about collecting some statistics.
> >
> > The idea is similar to some disk utilities that collects and sort the
> sizes
> > of directories. You know when every folder on the computer is scanned and
> > all the resulting paths are sorted by the summed size. Such utilities
> > usually help to find space on the hard drive to free.
> >
> ....
>
> This is basically what valgrind (or fulldebugmode of fastmm) does. But they
> do this by parsing the stack on each call to the memory manager, and then
> keep track of it.
>
> Note that all these techniques can be very, very slowing. E.g. I tried to
> debug
> the CHM support with valgrind, and I terminated the valgrind process after
> 5
> hours because it was not even half way to where the bug was.
>
> Without valgrind the program reached the point in 1-2 minutes.....
>
>

Thanks, I suspected that it's already implemented and that it should be very
slow :)
But looking at your numbers, if one implements something and finds a way to
decrease this 150x factor  (300 min/2min=150), the tool will be more useful


On Mon, Aug 15, 2011 at 1:17 PM, Ludo Brands <ludo.brands at free.fr> wrote:

>
> The valgrind massif tool (valgrind --tool=massif) does the same but reports
> on a sampling basis. It'll look at the heap used and report who allocated
> what on a cumulative basis. It won't trace every call nor report leaks but
> it allows you to track the big users quite well. I'm currently tracking the
> memory "eaters" in lazarus with it. It slows down the program but with a
> factor 5 to 10 which makes it more practical than valgrid itself.
>
>
if there's a common ancestor allocating something (let's call it NewBlock()
and it uses GetMem) and I have many descendants using this method, is there
a chance to find the "eater" amongst these descendants or massif tool will
drop all the stats to NewBlock()?

Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20110815/24e29aa8/attachment.html>


More information about the fpc-pascal mailing list