I have written a perl program to operate on huge datasets. I am trying to profile its excution in terms of its memory usage. Tried using valgrind on small datasets, but it slows down the execution dramatically. I am looking for just heap profiling. Could you guys suggest some ways ?
相关问题
- What uses more memory in c++? An 2 ints or 2 funct
- $ENV{$variable} in perl
- Memory for python.exe on Windows 7 python 32 - Num
- Is it possible to pass command-line arguments to @
- Redirecting STDOUT and STDERR to a file, except fo
相关文章
- Why are memory addresses incremented by 4 in MIPS?
- Running a perl script on windows without extension
- Why doesn't valgrind detect a memory leak in m
- Comparing speed of non-matching regexp
- Is there anyway a valgrind message “Conditional ju
- Can NOT List directory including space using Perl
- Is my heap fragmented
- Extracting columns from text file using Perl one-l
When I used Google and the search term 'perl memory profile', one of the first items points to the Perl module
Devel::Size
as one way of spotting memory usage. There are also memory leak detector modules lurking around.The new Devel::SizeMe module provides detailed visibility into the heap memory usage of a perl program or data structure. There's a blog post introducing Devel::SizeMe, including links to talk slides and screencast.
We used
Devel::Leak
. To work fully, you need a debugging compiled Perl, but even without that, you can count and log the number of allocated scalars, hashes, and arrays, as your code runs, at various key points. That was enough to pin down the leaks we had.use Memchmark.