in reply to A way to see how much 'memory' a program will take up in, say, mod_perl, so I can start to optimize it?

I may be missing something here, but couldn't you use the /proc filesystem? Read /proc/self/status or /proc/pid/status from a test harness and you can interrogate the line VmData and figure out how many pages it has used.

Also, you may like perldebguts, you can get a lot of memory info if Perl was built with its own malloc.

Also also, I remember from the way-back C days there was a call 'sbrk()' which told you in a relatively pan-system way where you were with memory allocation, it is how malloc works. In Perl you'd need an XS to get at it, but again CPAN may come to the rescue.

HTH,
SSF

  • Comment on Re: A way to see how much 'memory' a program will take up in, say, mod_perl, so I can start to optimize it?