voncunth has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks.. when embedding a perl interpreter in my C code i have been doing all the necessary cleanup at the end ... but when adding extension "glue code" needed to use modules like Socket.pm or DBI.pm etc ... there is memory i am not freeing and I don't know how to do it! for example if i run perl_parse(..) without the extension glue and run the code through valgrind i see that i am properly freeing all heap memory .. when i include my "xsinit" function in perl_parse(..) including bootstrap for Socket and Data::Dumper valgrind says i have 16 bytes not free'd

Replies are listed 'Best First'.
Re: PerlEmbed Memory leak
by davido (Cardinal) on Oct 01, 2013 at 16:11 UTC

    It would help if we could see a test case that exhibits the behavior. It should be possible to demonstrate leaky code in less than 50 lines of C, if you eliminate any code that is irrelevant to the problem.


    Dave