変数が使用しているメモリ量をしらべることができます。
#!/usr/bin/perl use warnings; use strict; use Devel::Size qw(total_size size); my $ref ={ hoge => 'hogehoge' , hage => 'hageghe' }; printf("%d\n", size ( $ref )); printf("%d\n" , total_size ( $ref ) );
Devel::Size, because of the way it works, can consume a considerable amount of memory as it runs. It will use five pointers, two integers, and two bytes worth of storage, plus potential alignment and bucket overhead, per thing it looks at. This memory is released at the end, but it may fragment your free pool, and will definitely expand your process' memory footprint.
使用するとフレグメントが起きる可能性があるので注意とのこと。
タグ
このページへのコメント
PMsSl4 <a href="http://xrvhnnpmhxjj.com/">xrvhnnpmhxjj</a>, [url=http://hidmjccjwikz.com/]hidmjccjwikz[/url], [link=http://apeycffxmvzw.com/]apeycffxmvzw[/link], http://xizbuqccjpvu.com/