Skip Menu |

This queue is for tickets about the Log-Handler CPAN distribution.

Report information
The Basics
Id: 89250
Status: open
Priority: 0/
Queue: Log-Handler

Owner: Nobody in particular
Requestors: gkpect [...]

Bug Information
Severity: Normal
Broken in: 0.71
Fixed in: (no value)

Subject: dump() calls Dumper even if log_level is not matched
Download (untitled) / with headers
text/plain 612b
Call of $log->dump( $huge_data_structure ) causes huge memory usage even if log level is not debug. For test script (attached) 'pmap' and 'time' show the following numbers: With $log->dump() string: Show quoted text
> Total 578336 kB
Show quoted text
> real 0m10.818s > user 0m9.259s > sys 0m0.623s
Without $log->dump() string: Show quoted text
> Total 152060 kB
Show quoted text
> real 0m2.057s > user 0m0.778s > sys 0m0.072s
Such memory and cpu time usage is caused by Data::Dumper. Suggested changes: call Dumper() after log level check. To be sure that message should be written to log file. ---- perl version: 5.8.8 Log::Handler version: 0.71 OS: RHEL 2.6.32 ----
text/x-perl 309b
#!/usr/bin/perl use strict; use warnings; use Log::Handler; my $huge = {}; for my $i (1..1000) { for my $j (1..1000) { $huge->{$i}->{$j} = 1; } } my $log = Log::Handler->get_logger( 'test' ); $log->dump( $huge ); # comment this string to decrease memory usage print "$$\n"; sleep(30);
Fixed in 0.80. Have fun.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to