[MTOS-dev] Memory Utilization Brainstorm
Alvar Freude
alvar at a-blast.org
Fri Dec 28 11:44:54 PST 2007
Hi,
-- Hirotaka Ogawa <hirotaka.ogawa at gmail.com> wrote:
> Hey, look!!! VmSize keeps to be the initial size!!!
good analysis! :)
But allow me one remark:
You should use "use strict" and "use warnings" even in such a test
snippet.
With this your script stops here:
> local $tmpl = MT::Template->new;
I guess you mean "my" and not "local"; see "perldoc -f local".
Perhaps this makes a difference at this test (not tested)?
> I expect that each applications can properly finalize MT::Template
> objects, as I showed, and can reduce memory usage.
hmm, but then every piece of code which uses MT::Template must be
checked. It would be better, when MT::Template does this by itself by
adding a DESTROY method, which should make the big cleanup. [1]
BTW: There are also Modules on CPAN which helps for searching for memory
leaks, e.g. Devel::Leak and Devel::Leak::Object
Ciao
Alvar
[1]
DESTROY gets called when the object gets out of scope, see "Destructors"
in perldoc perltoot.
--
** Alvar C.H. Freude, http://alvar.a-blast.org/
** http://www.assoziations-blaster.de/
** http://www.wen-waehlen.de/
** http://odem.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://www.sixapart.com/pipermail/mtos-dev/attachments/20071228/6111780b/attachment.bin
More information about the MTOS-dev
mailing list