开发者

Is there a way to see how much memory a variable uses?

开发者 https://www.devze.com 2023-03-29 23:21 出处:网络
I am working with Perl开发者_开发问答 for some months now. As for now, my scripts work but they are far from being perfect.

I am working with Perl开发者_开发问答 for some months now. As for now, my scripts work but they are far from being perfect.

I would now like to optimize the memory usage, thus I am looking for a way to break down the memory usage per variable/hash.

Is there a way to see how much memory a variable uses?


Devel::Size or Devel::Size::Report can be used to get memory usage for a variable/structure.

You might want to check perl guts illustrated to see what the numbers really mean.


Have a look at Devel::Size on CPAN.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号