[pve-devel] memory leak in PVE/QMPClient.pm

Stefan Priebe - Profihost AG s.priebe at profihost.ag
Mon Oct 29 13:05:14 CET 2012


i would suggest the following:

diff --git a/bin/pvestatd b/bin/pvestatd
index cb0d5cd..0345fe8 100755
--- a/bin/pvestatd
+++ b/bin/pvestatd
@@ -384,7 +384,7 @@ for (;;) { # forever

         my $mem = PVE::ProcFSTools::read_memory_usage();

-       if (!defined($initial_memory_usage)) {
+       if (!defined($initial_memory_usage) || $cycle < 10) {
             $initial_memory_usage = $mem->{resident};
         } else {
             my $diff = $mem->{resident} - $initial_memory_usage;

Mit freundlichen Grüßen
   Stefan Priebe
Bachelor of Science in Computer Science (BSCS)
Vorstand (CTO)

-------------------------------
Profihost AG
Am Mittelfelde 29
30519 Hannover
Deutschland

Tel.: +49 (511) 5151 8181     | Fax.: +49 (511) 5151 8282
URL: http://www.profihost.com | E-Mail: info at profihost.com

Sitz der Gesellschaft: Hannover, USt-IdNr. DE813460827
Registergericht: Amtsgericht Hannover, Register-Nr.: HRB 202350
Vorstand: Cristoph Bluhm, Sebastian Bluhm, Stefan Priebe
Aufsichtsrat: Prof. Dr. iur. Winfried Huck (Vorsitzender)

Am 29.10.2012 13:01, schrieb Stefan Priebe - Profihost AG:
> Am 29.10.2012 12:57, schrieb Dietmar Maurer:
>> fixed - please test again (sorry)
>
> My test was too short. Does not work to me:
>
> Oct 29 12:59:09 cloud1-1202 pvestatd[5868]: starting server
> Oct 29 12:59:10 cloud1-1202 pvestatd[5868]: restarting server after 2
> cycles to reduce memory usage (free 35692544 (7036928) bytes)
> Oct 29 12:59:10 cloud1-1202 pvestatd[5868]: server shutdown (restart)
> Oct 29 12:59:11 cloud1-1202 pvestatd[5868]: restarting server
> Oct 29 12:59:21 cloud1-1202 pvestatd[5868]: restarting server after 2
> cycles to reduce memory usage (free 37605376 (5599232) bytes)
> Oct 29 12:59:21 cloud1-1202 pvestatd[5868]: server shutdown (restart)
> Oct 29 12:59:21 cloud1-1202 pvestatd[5868]: restarting server
> Oct 29 12:59:31 cloud1-1202 pvestatd[5868]: restarting server after 2
> cycles to reduce memory usage (free 37605376 (5595136) bytes)
> Oct 29 12:59:31 cloud1-1202 pvestatd[5868]: server shutdown (restart)
> Oct 29 12:59:32 cloud1-1202 pvestatd[5868]: restarting server
> Oct 29 12:59:42 cloud1-1202 pvestatd[5868]: restarting server after 2
> cycles to reduce memory usage (free 37605376 (5599232) bytes)
> Oct 29 12:59:42 cloud1-1202 pvestatd[5868]: server shutdown (restart)
> Oct 29 12:59:42 cloud1-1202 pvestatd[5868]: restarting server
>
> I've seen that it takes up to 10 cycles to have a constant memory size.
> I think this is due to the fact that perls garbage collection is not
> running every after each cycle.
>
> Stefan



More information about the pve-devel mailing list