Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Memory usage within perl

I have been looking for a perl's internal variable or module than can give me the memory usage for variables/hashes/arrays and called within the script I am analyzing .. for the script's used memory I found:

open( STAT , "</proc/$$/stat" )
or die "Unable to open stat file";
@stat = split /\s+/ , <STAT>;
close( STAT );

but I want to track a particular variable not the process' memory.

Does something like that exist???

like image 533
Juan Avatar asked Jan 29 '26 17:01

Juan


1 Answers

You should look at the Devel::Size module.

like image 197
Mat Avatar answered Jan 31 '26 05:01

Mat