in reply to Re: Weird memory leak in Catalyst application using Catalyst::Model::KiokuDB
in thread Weird memory leak in Catalyst application using Catalyst::Model::KiokuDB

How would Valgrind help with Perl data structures?

As far as I'm aware, Valgrind can only check whether a C program overwrites memory it has not allocated, and maybe can check whether a C program allocates memory and then loses the pointer(s) to that piece of memory. If you have a valid Perl scalar, Perl will keep a valid (C) pointer to it, and will release the memory during Global Destruction. If that's true, then Valgrind will/can not flag this Perl value as ever lost, even though it may be a memory leak in the sense that there is no Perl structure from the running set of Perl variables to access that piece of memory.

  • Comment on Re^2: Weird memory leak in Catalyst application using Catalyst::Model::KiokuDB

Replies are listed 'Best First'.
Re^3: Weird memory leak in Catalyst application using Catalyst::Model::KiokuDB
by zwon (Abbot) on Aug 01, 2011 at 14:14 UTC

    I recently spent quite a lot of time trying to find memory leak in Perl code, and finally ran it through Valgrind and discovered that it is YAML::XS. For sure it will not help with Perl structures, but I never said that.