简体   繁体   中英

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???

你应该看看Devel :: Size模块。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM