On Nov 30, 2003, at 2:39 PM, R. Joseph Newton wrote:


Does the difference between the two memory readings represent a memory leak?
I think that is unlikely. If it were a true memory leak, it would have t
aken a much geater toll. More like the OS simply lets the program keep memory
that it seems to need, thus sparing the overhead of further requests.
The second round of loading this hash certainly wnent much more quickly,
since Perl could use its own internal allocation routines.

I'm not sure I get your question/assertion here. Are you attempting to establish that it is impossible in perl to have memory leaks?

are you asking me to write you leaky perl code
to show you how to do it???

Have you actually read say

perldoc -q "How can I free an array or hash so my program shrinks"

so that you understand that once allocated to the program
that memory is not going to be handed back to the system?
And that as such, that is not a 'memory leak'? Just as
is true in the case of say C, C++, etc???

The reason that the 2..N iteration of reusing the same
memory that has been allocated runs faster is because
the memory space has already been allocated to the code.
Whereas in the first instance of growing out code runs
'slower' is that one is in the process of doing all of
the malloc-ing to get that code ( cf man malloc ).

Other things you might want to read on would be say:

<http://www.perldoc.com/perl5.8.0/pod/perl561delta.html#Known-Problems>
<http://www.perldoc.com/perl5.8.0/pod/perldebguts.html#Debugging-Perl- memory-usage>



ciao drieux

---


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to