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

ok so more issues with my Embedded code - I hear the collective groan from here!

I traced it through with a memory monitor on in a seperate session and this is what I discovered....

my_perl = perl_alloc();

(+4)
perl_construct(my_perl);

(+4)
perl_parse(my_perl, xs_init, 2, my_argv, (char **)NULL);

(+1056)
perl_run(my_perl); Perldatabase(pseudo, queue);

(+4)
perl_destruct (my_perl); perl_free(my_perl); return (queue);
Now I would have though perl_free(my_perl) should do something but it appears not to release any memory?
Thanks
Tom

Replies are listed 'Best First'.
(jeffa) Re: Yet another Embedding question
by jeffa (Bishop) on Jul 28, 2003 at 16:45 UTC
    This is not an answer, but a request. When you post a question that is an extension of other posts, please reference them: That way, those who have not been following along may have a chance to catch up. Normally i would /msg this information, but posting may serve as history for these others (like me) who have seen this post, but not your previous posts. Best of luck, i have no clue what the problem is. :/

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      Good point - very inconsiderate of me!
Re: Yet another Embedding question
by PodMaster (Abbot) on Jul 28, 2003 at 17:28 UTC
      Thanks - looks like an internal Perl issue... which is bad... I hope the Wise Ones know of a way to resolve this issue - else I will have to scrap the whole thing and re-write it in another language... Is that Blasphamy in here?
      my thanks to all that have attempted to look at this issue.
      Tom
        A solution has been found!

        I moved the compilation of the perl script  perl_parse out of the loop and passed the pointer to the memory around in C - this cut the memory loss from 1072 down to 8 per message. Much more manageable!

        Thanks all
Re: Yet another Embedding question
by TomDLux (Vicar) on Jul 28, 2003 at 17:26 UTC

    I'm not familiar with the memory monitor you're using ... what does it actually monitor? The memory being used by the program?

    It is common for systems to obtain memory from the system but never actually release it. Instead, when you delete an object, the memory is put into a free pool by your program, so future requests are filled frfom the pool rather than from system requests.

    --
    TTTATCGGTCGTTATATAGATGTTTGCA