Revert change 23843.
[p5sagit/p5-mst-13.2.git] / pod / perldebguts.pod
index d353ada..7cce156 100644 (file)
@@ -111,15 +111,15 @@ calls are not possible, even though C<&DB::sub> exists.
 =head2 Writing Your Own Debugger
 
 =head3 Environment Variables
+
 The C<PERL5DB> environment variable can be used to define a debugger.
 For example, the minimal "working" debugger (it actually doesn't do anything)
 consists of one line:
-  
+
   sub DB::DB {}
 
 It can easily be defined like this:
-  
+
   $ PERL5DB="sub DB::DB {}" perl -d your-script
 
 Another brief debugger, slightly more useful, can be created
@@ -130,9 +130,9 @@ with only the line:
 This debugger prints a number which increments for each statement
 encountered and waits for you to hit a newline before continuing
 to the next statement.
-  
+
 The following debugger is actually useful:
-  
+
   {
     package DB;
     sub DB  {}
@@ -151,7 +151,7 @@ after the debugger completes its own initialization.)
 After the rc file is read, the debugger reads the PERLDB_OPTS
 environment variable and uses it to set debugger options. The
 contents of this variable are treated as if they were the argument
-of an C<O ...> debugger command (q.v. in L<perldebug/Options>).
+of an C<o ...> debugger command (q.v. in L<perldebug/Options>).
 
 =head3 Debugger internal variables
 In addition to the file and subroutine-related variables mentioned above,
@@ -183,7 +183,7 @@ C<"$break_condition\0$action">.
 
 =back
 
-=head3 Debugger customization fucntions
+=head3 Debugger customization functions
 
 Some functions are provided to simplify customization.
 
@@ -240,9 +240,9 @@ information.  For example, contrast this expression trace:
  main::bar((eval 170):2):
  42
 
-with this one, once the C<O>ption C<frame=2> has been set:
+with this one, once the C<o>ption C<frame=2> has been set:
 
-   DB<4> O f=2
+   DB<4> o f=2
                 frame = '2'
    DB<5> t print foo() * bar()
  3:      foo() * bar()
@@ -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';