pvestatd: fix server reload

This commit is contained in:
Dietmar Maurer 2012-10-29 12:32:53 +01:00
parent 7f9cfa4c97
commit 6d00167c16
3 changed files with 18 additions and 5 deletions

View File

@ -352,6 +352,8 @@ sub restart_server {
exit (-1); # never reached?
}
my $initial_memory_usage;
for (;;) { # forever
eval {
@ -382,10 +384,15 @@ for (;;) { # forever
my $mem = PVE::ProcFSTools::read_memory_usage();
if ($mem->{resident} > (35*1024*1024)) {
syslog ('info', "restarting server after $cycle cycles to " .
"reduce memory usage (free $mem->{resident} bytes)");
restart_server ();
if (!defined($initial_memory_usage)) {
$initial_memory_usage = $mem->{resident};
} else {
my $diff = $mem->{resident} - $initial_memory_usage;
if ($diff > 5*1024*1024) {
syslog ('info', "restarting server after $cycle cycles to " .
"reduce memory usage (free $mem->{resident} ($diff) bytes)");
restart_server ();
}
}
my $wcount = 0;

View File

@ -1,3 +1,9 @@
pve-manager (2.2-25) unstable; urgency=low
* pvestatd: fix server reload (due to memory leak)
-- Proxmox Support Team <support@proxmox.com> Mon, 29 Oct 2012 12:32:28 +0100
pve-manager (2.2-24) unstable; urgency=low
* vncproxy: wait until vnc port is ready (avoid connection errors)

View File

@ -2,7 +2,7 @@ RELEASE=2.2
VERSION=2.2
PACKAGE=pve-manager
PACKAGERELEASE=24
PACKAGERELEASE=25
BINDIR=${DESTDIR}/usr/bin
PERLLIBDIR=${DESTDIR}/usr/share/perl5