summaryrefslogtreecommitdiff
path: root/pod/perldebguts.pod
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-08-09 08:07:22 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-08-09 08:07:22 +0000
commitb30f304ae36b3931349d7d5816f5a5646afe5397 (patch)
tree457ac3879571005e8254a07700587aacb671c1eb /pod/perldebguts.pod
parent2611e30b2cfc225355f77ac14b45bee31bc2bf54 (diff)
downloadperl-b30f304ae36b3931349d7d5816f5a5646afe5397.tar.gz
Some updates for the memory use debugging section:
-DL is obsolete, mention Devel::Size, and Purify and valgrind. p4raw-id: //depot/perl@20579
Diffstat (limited to 'pod/perldebguts.pod')
-rw-r--r--pod/perldebguts.pod23
1 files changed, 17 insertions, 6 deletions
diff --git a/pod/perldebguts.pod b/pod/perldebguts.pod
index cde70b2fb0..7cce15631a 100644
--- a/pod/perldebguts.pod
+++ b/pod/perldebguts.pod
@@ -749,12 +749,20 @@ eightfold increase. This means that the compiled form of reasonable
about eight times more space in memory than the code took
on disk.
-There are two Perl-specific ways to analyze memory usage:
-$ENV{PERL_DEBUG_MSTATS} and B<-DL> command-line switch. The first
-is available only if Perl is compiled with Perl's malloc(); the
-second only if Perl was built with C<-DDEBUGGING>. See the
-instructions for how to do this in the F<INSTALL> podpage at
-the top level of the Perl source tree.
+The B<-DL> command-line switch is obsolete since circa Perl 5.6.0
+(it was available only if Perl was built with C<-DDEBUGGING>).
+The switch was used to track Perl's memory allocations and possible
+memory leaks. These days the use of malloc debugging tools like
+F<Purify> or F<valgrind> is suggested instead.
+
+One way to find out how much memory is being used by Perl data
+structures is to install the Devel::Size module from CPAN: it gives
+you the minimum number of bytes required to store a particular data
+structure. Please be mindful of the difference between the size()
+and total_size().
+
+If Perl has been compiled using Perl's malloc you can analyze Perl
+memory usage by setting the $ENV{PERL_DEBUG_MSTATS}.
=head2 Using C<$ENV{PERL_DEBUG_MSTATS}>
@@ -861,6 +869,9 @@ never touched.
=head2 Example of using B<-DL> switch
+(Note that -DL is obsolete since circa 5.6.0, and even before that
+Perl needed to be compiled with -DDEBUGGING.)
+
Below we show how to analyse memory usage by
do 'lib/auto/POSIX/autosplit.ix';