Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I always wanted to know memory usage of particular structure in my perl programs. Recently, I noticed that Storable file size corresponds nicely to memory usage of my application, so I used that as a hint of memory usage before loading data.
Then, I decided to show usage of already loaded data. Using Devel::Size total_size seemed like the way to go, but it's much slower than simple Storable piping to /dev/null using this code To be honest, I didn't expect so much difference. I can probably setup pipes myself to get a bit more performance, but I would really like to know alternative ways to find out perl memory usage without performance impact. I'm experimenting with this code in gist on github as a log of things that I tried. 2share!2flame... In reply to Finding memory usage of perl structure efficiently by dpavlin
|
|