in reply to Obtaining refcount for all variables
result$s = "you are ".int(rand(11))." on a score of 0 to 10"; print "refcount is ".Internals::SvREFCNT($s)."\n";
Is the refcount the correct way to figure out whats being a memory hog? maybe yes, if you trying to look for something that is overreferenced, in most of the time no. I suggest looking at Devel::LeakTrace (used it personally, it never found a SV leak, it was a malloc C leak). Next question is, are your memory problems from the perl script you are running, or from XS modules you are running? And do you have a memory leak (steady slow increase in ram over time), or are simply trying to reduce runtime ram bloat of the process?refcount is 1
|
|---|