Skip Menu |

This queue is for tickets about the BSD-devstat CPAN distribution.

Report information
The Basics
Id: 98050
Status: new
Priority: 0/
Queue: BSD-devstat

People
Owner: Nobody in particular
Requestors: sparvu [...] systemdatarecorder.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.02
Fixed in: (no value)



Subject: memory consumption in BSD::devstat
Im using BSD::Devstat in a while loop to retrieve disk statistics for a long period of time. The module does not have any get method so every loop I need to make a new object to retrieve the new stats. This leads to a continuous memory consumption for my perl process. Can you consider to: 1. Add a new get method for BSD::devstat that we could create one object and then simple call get() every loop ? 2. Look and check if there are no memory leaks within the .xs code when doing while(1) continuous loop. See how it does look: 1. Starting using RES=5688K last pid: 80180; load averages: 0.24, 0.22, 0.24 up 14+18:12:35 16:00:21 24 processes: 1 running, 23 sleeping CPU: 0.5% user, 0.0% nice, 0.5% system, 0.0% interrupt, 99.1% idle Mem: 14M Active, 11M Inact, 663M Wired, 13M Cache, 109M Buf, 262M Free ARC: 428M Total, 224M MFU, 99M MRU, 16K Anon, 16M Header, 88M Other Swap: 2048M Total, 16M Used, 2032M Free PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND 80180 sdr 1 20 0 32824K 5688K pause 0:00 0.00% perl After 1.5 minutes: RES=8824K 2. last pid: 80181; load averages: 0.23, 0.22, 0.24 up 14+18:13:33 16:01:19 24 processes: 1 running, 23 sleeping CPU: 1.4% user, 0.0% nice, 0.0% system, 0.0% interrupt, 98.6% idle Mem: 17M Active, 11M Inact, 663M Wired, 13M Cache, 109M Buf, 259M Free ARC: 428M Total, 224M MFU, 99M MRU, 16K Anon, 16M Header, 88M Other Swap: 2048M Total, 16M Used, 2032M Free PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND 80180 sdr 1 20 0 36920K 8824K nanslp 0:00 0.00% perl Im running the recorder on a very aggressive interval time to simulate this bug. Simple code to repeat: use strict; use warnings; use BSD::devstat; my $count = 0; ### MAIN BODY while (1) { # get new devstats my $bds1 = BSD::devstat->new(); $count++; ### Interval sleep 1; }
From: sparvu [...] systemdatarecorder.org
Can we have something like: my $lastpid = BSD::Sysctl->new( 'kern.lastpid' ); while (1) { print $lastpid->get(), $/; sleep 1; } for BSD::devstat ? Or how one would fetch via a while(1) disk stats ?