Changeset 998c2340a84751cc98233c2f54b2ff06038fae2a

Show
Ignore:
Timestamp:
10/20/09 22:00:36 (5 years ago)
Author:
Mark Harrison <mark@omniti.com>
git-committer:
Mark Harrison <mark@omniti.com> 1256076036 +0000
git-parent:

[515131ccfa898b2fde519d866813438739744647]

git-author:
Mark Harrison <mark@omniti.com> 1256076036 +0000
Message:

Fix memory leak with the freemem check

git-svn-id: https://labs.omniti.com/resmon/trunk@219 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/Resmon/Module/FREEMEM.pm

    ra644afe r998c234  
    2424@ISA = qw/Resmon::Module/; 
    2525 
     26my $usekstat = 0; 
     27my $kstat; 
     28if ($^O eq 'solaris') { 
     29    eval "use Sun::Solaris::Kstat"; 
     30    unless ($@) { 
     31        $usekstat = 1; 
     32        $kstat = Sun::Solaris::Kstat->new(); 
     33    } 
     34} 
    2635 
    2736sub handler { 
     
    4958        close(MEMINFO); 
    5059    } elsif ($^O eq 'solaris') { 
    51         eval "use Sun::Solaris::Kstat"; 
    52         if ($@) { 
     60        if (!$usekstat) { 
    5361            # Kstat isn't available 
    5462            if ($includecache) { 
     
    7179        } else { 
    7280            # We have kstat, use that for everything 
    73             my $kstat = Sun::Solaris::Kstat->new(); 
    7481            my $pagesize = `pagesize`; 
    7582            my $syspages = $kstat->{unix}->{0}->{system_pages};