summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-12-08 11:00:44 +0000
committerNorbert Preining <preining@logic.at>2009-12-08 11:00:44 +0000
commitbc13381011ffaa60b55b19b6ea86fd4bbdc7f9e9 (patch)
treedc2eb4d0e24270a77372c981f8f539ebbc46f4a9 /Master
parent27cd8d14d5b658b8d8b6f1cbc29ab098677465fc (diff)
destroy some entries if they are not needed anymore
git-svn-id: svn://tug.org/texlive/trunk@16327 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/tlpkg/dev/tlmgrgui2.pl41
1 files changed, 41 insertions, 0 deletions
diff --git a/Master/tlpkg/dev/tlmgrgui2.pl b/Master/tlpkg/dev/tlmgrgui2.pl
index 60d13547435..e850fdb83d0 100644
--- a/Master/tlpkg/dev/tlmgrgui2.pl
+++ b/Master/tlpkg/dev/tlmgrgui2.pl
@@ -23,6 +23,7 @@ use Tk::ROText;
use Tk::HList;
use Tk::ItemStyle;
#use TeXLive::Splashscreen;
+#use Devel::Leak;
use TeXLive::TLUtils qw(setup_programs platform_desc win32 debug);
use TeXLive::TLConfig;
@@ -1429,6 +1430,7 @@ sub setup_list {
$Packages{$p}{'installed'} = 1;
$Packages{$p}{'selected'} = 0;
$Packages{$p}{'tlp'} = $tlp;
+ $Packages{$p}{'cb'}->destroy() if defined($Packages{$p}{'cb'});
$Packages{$p}{'cb'} = $g->Checkbutton(-variable => \$Packages{$p}{'selected'});
if (($tlp->category eq "Collection") ||
($tlp->category eq "Scheme")) {
@@ -1468,9 +1470,12 @@ sub setup_list {
sub update_list_remote {
my @do_later_media;
+ #my $handle;
+ #Devel::Leak::NoteSV($handle);
# clear old info from remote media
for my $p (keys %Packages) {
if (!$Packages{$p}{'installed'}) {
+ $Packages{$p}{'cb'}->destroy() if defined($Packages{$p}{'cb'});
delete $Packages{$p};
next;
}
@@ -1553,6 +1558,42 @@ sub update_list_remote {
$Packages{$p}{'displayname'} = "collection-doc-$1";
}
}
+ #Devel::Leak::CheckSV($handle);
+ #warn join(",", currmem());
+}
+
+sub currmem {
+ my $pid = shift || $$;
+ if (open(MAP, "dd if=/proc/$pid/map bs=64k 2>/dev/null |")) { # FreeBSD
+ my $mem = 0;
+ my $realmem = 0;
+ while(<MAP>) {
+ my(@l) = split /\s+/;
+ my $delta = (hex($l[1])-hex($l[0]));
+ $mem += $delta;
+ if ($l[11] ne 'vnode') {
+ $realmem += $delta;
+ }
+ }
+ close MAP;
+ ($mem, $realmem);
+ } elsif (open(MAP, "/proc/$pid/maps")) { # Linux
+ my $mem = 0;
+ my $realmem = 0;
+ while(<MAP>) {
+ my(@l) = split /\s+/;
+ my($start,$end) = split /-/, $l[0];
+ my $delta = (hex($end)-hex($start));
+ $mem += $delta;
+ if (!defined $l[5] || $l[5] eq '') {
+ $realmem += $delta;
+ }
+ }
+ close MAP;
+ ($mem, $realmem);
+ } else {
+ undef;
+ }
}