Skip Menu |

This queue is for tickets about the Sys-Statistics-Linux CPAN distribution.

Report information
The Basics
Id: 43472
Status: rejected
Priority: 0/
Queue: Sys-Statistics-Linux

People
Owner: Nobody in particular
Requestors: matt.mcdonald [...] datafort.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.47
Fixed in: (no value)



Subject: DiskUsage - Cannot allocate memory
I have a script that makes use of Sys::Statistics::Linux::DiskUsage. This script is installed on multiple SUSE virtual machines (SUSE 10.1). It has been compiled as a PAR executable on a SUSE machine (SUSE 10.3) using Sys::Statistics::Linux version 0.47 and Perl version 5.8.8. After running the script for roughly 20 days, every 5 to 10 seconds (roughly 200,000 times) I am now getting the following error which I only managed to fix by rebooting: Sys::Statistics::Linux:DiskUsage: unable to execute 'df -kP' (Cannot allocate memory) at Sys/Statistics/Linux.pm line 477 If I run df -kP manually there isn't a problem. I have attached the part of my code which uses DiskUsage.
Subject: diskInfo.pm
my $lxs = Sys::Statistics::Linux -> new ( diskusage => 1 ); my $disk_stat = $lxs -> get -> {'diskusage'}; while ( my ( $key , $value ) = each ( %$disk_stat ) ) { my $mnt = $disk_stat -> {$key} -> {'mountpoint'}; if ( exists $disk_loc{$mnt} ) { my $id = $disk_loc{$mnt}; my $total_size = ( $disk_stat -> {$key} -> {'total'} * 1024 ); my $free_size = ( $disk_stat -> {$key} -> {'free'} * 1024 ); $p_return{"loc_$id"} = $mnt; $p_return{"total_$id"} = $total_size; $p_return{"free_$id"} = $free_size; } }
I should also add that the virtual machines each have roughly 372MB of RAM. I have the script running on servers with about 2GB of RAM and so far (30 days) they haven't broken, but I expect eventually they will.
Sorry, I cannot help you with this problem. Take a look to the source of DiskUsage.pm: sub get { my (%disk_usage, $disk_name); ... ... return \%disk_usage; } A new hash is created and returned and I don't think that Linux.pm or DiskUsage.pm produce memory leaks or any else. Please consult the developers of PAR.