diff options
author | Jim Cromie <jim.cromie@gmail.com> | 2009-06-20 09:43:43 -0600 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-06-21 14:11:52 +0200 |
commit | 10a879f5b15504fdd9aa98740d738732eeee2f22 (patch) | |
tree | 1872a9822aaabc195628f935d7240b7b030613a1 /pod/perlhack.pod | |
parent | 1cd8acb500c6fd96bf025feb0647211c271b7e2e (diff) | |
download | perl-10a879f5b15504fdd9aa98740d738732eeee2f22.tar.gz |
update PERL_MEM_LOG in perlhack.pod
Diffstat (limited to 'pod/perlhack.pod')
-rw-r--r-- | pod/perlhack.pod | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/pod/perlhack.pod b/pod/perlhack.pod index a0e9e02c04..75fa1b73cd 100644 --- a/pod/perlhack.pod +++ b/pod/perlhack.pod @@ -2942,27 +2942,29 @@ by C<-DPERL_MEM_LOG> instead. =head2 PERL_MEM_LOG -If compiled with C<-DPERL_MEM_LOG>, all Newx() and Renew() allocations -and Safefree() in the Perl core go through logging functions, which is -handy for breakpoint setting. If also compiled with C<-DPERL_MEM_LOG_STDERR>, -the allocations and frees are logged to STDERR (or more precisely, to the -file descriptor 2) in these logging functions, with the calling source code -file and line number (and C function name, if supported by the C compiler). - -This logging is somewhat similar to C<-Dm> but independent of C<-DDEBUGGING>, -and at a higher level (the C<-Dm> is directly at the point of C<malloc()>, -while the C<PERL_MEM_LOG> is at the level of C<New()>). - -In addition to memory allocations, SV allocations will be logged, just as -with C<-Dm>. However, since the logging doesn't use PerlIO, all SV allocations -are logged and no extra SV allocations are introduced by enabling the logging. -If compiled with C<-DDEBUG_LEAKING_SCALARS>, the serial number for each SV -allocation is also logged. - -You can control the logging from your environment if you compile with -C<-DPERL_MEM_LOG_ENV>. Then you need to explicitly set C<PERL_MEM_LOG> and/or -C<PERL_SV_LOG> to a non-zero value to enable logging of memory and/or SV -allocations. +If compiled with C<-DPERL_MEM_LOG>, both memory and SV allocations go +through logging functions, which is handy for breakpoint setting. + +Unless C<-DPERL_MEM_LOG_NOIMPL> is also compiled, the logging +functions read ENV{PERL_MEM_LOG} to determine whether to log the +event, and if so how: + + ENV{PERL_MEM_LOG} =~ /m/ Log all memory ops + ENV{PERL_MEM_LOG} =~ /s/ Log all SV ops + ENV{PERL_MEM_LOG} =~ /t/ include timestamp in Log + ENV{PERL_MEM_LOG} =~ /^(\d+)/ write to FD given (default is 2) + +Memory logging is somewhat similar to C<-Dm> but is independent of +C<-DDEBUGGING>, and at a higher level; all uses of Newx(), Renew(), +and Safefree() are logged with the callers source code file and line +number (and C function name, if supported by the C compiler). In +contrast, C<-Dm> is directly at the point of C<malloc()>. SV logging +is similar. + +Since the logging doesn't use PerlIO, all SV allocations are logged +and no extra SV allocations are introduced by enabling the logging. +If compiled with C<-DDEBUG_LEAKING_SCALARS>, the serial number for +each SV allocation is also logged. =head2 Profiling |