-----BEGIN PGP SIGNED MESSAGE----- Moin,
On 05-Oct-02 Slaven Rezic carved into stone: > Tels <[EMAIL PROTECTED]> writes: > >> -----BEGIN PGP SIGNED MESSAGE----- >> >> Moin, >> >> On 05-Oct-02 [EMAIL PROTECTED] carved into stone: >> > En op 5 oktober 2002 sprak Ann Barcomb: >> >> I hadn't looked in to how I could solve my question, and because >> >> it was given to me as a low priority task, I wasn't sure I was going >> >> to have a chance to either. But you can count me as someone who will >> >> be very happy about the module :) >> > >> > I noticed CPAN Proc::ProcessTable, which is worth a look, if only >> > to peer at the code and note the portability, er, challenges. >> > If the module that reports memory usage itself consumes significant >> > memory, that is a pest when trying to figure out how much memory >> >> > a Perl data structure is using. That is the nice thing about >> > Merijn's original sbrk() -- it is lightweight in the extreme. >> >> Yes, but more or less useless, since: >> >> * your system might not have it, so you either get nothing, or something >> incompatible (depending on how it is implemented, or not) in >> Devel::MemUses >> * it doesn't reflect the true usage of a perl structure anyway, it just >> reports a change in the heap, which might or might not be related. > > With "usage of a perl structure", do you mean the size of an SV, plus > the size of an XPV, plus the malloced area for the string, etc.? I Yes, that is what I thought. > think the heap usage is more important, because these is the memory > taken from the system and not useable for other processes. But shouldn't that be just the same, or slightly more (if the memory is used in chunks of, let's say 16 bytes, it might alloc up to 15 more).? Or did I understand something wrong? Nevertheless, making your data structures smaller will help, even if in some particulare case it doesn't reduce the heap usage directly. Also, comparing how much mem an array if SVs takes to a string etc would be very usefull (for me). Cheers, Tels - -- perl -MDev::Bollocks -le'print Dev::Bollocks->rand()' revolutionarily customize unique technologies http://bloodgate.com/perl My current Perl projects PGP key available on http://bloodgate.com/tels.asc or via email -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. iQEVAwUBPZ7uCHcLPEOTuEwVAQEjlQf8D40dG0AeWRl/MEmojQuhW/JUAU9C+HKs ihzVjxo/pMKx7sTvHfyag1f6NnOHCwOQBz68zqtJq0OPgQKl29zSmPms38Eb1MAu p+NKVxFFGYuOQAbUZsA9+duwhtkg55kArHeE2TEHkUfNQPR3L14gWybFc1jnLKEU JjWkUZYhTu/MWUxFlrvY5xt+vchGKiLVIz4UIQ5L7BIqY9aMnW0+tpEQwj/nkqaQ G3dkyOEJFAbIeYHPZB9LwEbOSER0x/a2uNzo9EwmjvjBuYa1hpwgPryt/F1Ffvpy nKt037n8XECBPV6dMmaRYg0zb0cysti9PlwU2A4OKnIPg2+6AR9fMQ== =onR3 -----END PGP SIGNATURE-----