[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: After retrieving data from DB, the memory doesn't seem to be freed up


On 5/10/07, Lionel MARTIN <suppressed> wrote:
> There's really no difference in the way globals behave under mod_perl.
> You just don't notice it under CGI because the process quits right
> after the request has been served.
[...]
So, this clearly shows that the global variables sticks in memory, while the
lexical one doesn't.
So, I would imagine that after the script is run, space used by the lexical
variable would be freed up.

That's what I'm telling you -- it won't be.  The value will be gone,
but the memory allocated to it will still be allocated to it.  It
won't be reused for other variables unless you undef $lexical.

The other thing I was trying to explain is that the behavior of
globals and lexicals is not affected by mod_perl.  They behave the
same way in any perl program.

- Perrin


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.