in reply to Re^2: Bare-bones embedding and memory leakage
in thread Bare-bones embedding and memory leakage

why do I need PUSHMARK(SP)
You don't need PUSHMARK, and in fact using it there is wrong. You only need it when the the thing you're calling expects a list of args on the stack (eg when calling call_pv()). Here, you're using eval_pv(), which doesn't expect a list of args, so using it is wrong.

VmSize of around 4 kB every million iteration
IIRC, there was a bug that caused every 65536th allocated op not to be freed; this is fixed in recent Perls. You don't say which version you're using, but try it with something like 5.8.6 and see if the residual leak goes away.

Dave.

Replies are listed 'Best First'.
Re^4: Bare-bones embedding and memory leakage
by polettix (Vicar) on Mar 17, 2005 at 13:44 UTC
    Thank you for the advice. I'll make penance in my cell to espiate my lack of carefulness in providing useful information to the Wise Monks.

    As a novice, I ask you comprehension for being still stuck on ancient perl, v5.8.0 built for i386-linux; I'll try to remedy ASAP and rescue myself.

    --Flavio

Re^4: Bare-bones embedding and memory leakage
by polettix (Vicar) on Mar 18, 2005 at 17:32 UTC
    Woah, I'm a happy novice now!

    I just installed the last stable version of Perl (according to your suggestion) and eventually managed to get rid of the memory loss problem!

    Incidentally, I also realised (thanks to the compiler) that the dSP line was superfluous as well in my do_something function.

    -- Don't fool yourself.