From fc6217965abd5255c3758af5f34312425b7053e0 Mon Sep 17 00:00:00 2001 From: joeshaw Date: Mon, 4 Dec 2006 02:39:54 +0000 Subject: [PATCH] Change the GC.GetTotalMemory() threshold to 10%; otherwise there are just too many snapshots --- beagled/BeagleDaemon.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/beagled/BeagleDaemon.cs b/beagled/BeagleDaemon.cs index 8ac5cc62..77c82ce2 100644 --- a/beagled/BeagleDaemon.cs +++ b/beagled/BeagleDaemon.cs @@ -79,6 +79,7 @@ namespace Beagle.Daemon { private static int prev_rss = -1; private static long prev_gc = -1; + private static int sigprof_count = 0; private static void MaybeSendSigprof (int rss, long gc) { @@ -88,18 +89,20 @@ namespace Beagle.Daemon { if (prev_rss == -1 || prev_gc == -1) return; - if (rss - prev_rss > 5000 || - (double) rss / (double) prev_rss > 1.05) + // Log RSS increases of at least 5 megs or 5% + if (rss - prev_rss >= 5 * 1024 || + (double) rss / (double) prev_rss >= 1.05) send_sigprof = true; - if ((double) gc / (double) prev_gc > 1.05) + // Log total object size increase of at least 10%. + if ((double) gc / (double) prev_gc >= 1.1) send_sigprof = true; } finally { prev_rss = rss; prev_gc = gc; if (send_sigprof) { - Log.Debug ("Suspicious memory size change detected. Sending SIGPROF to ourself"); + Log.Debug ("Suspicious memory size change detected. Sending SIGPROF to ourself ({0})", sigprof_count++); Mono.Unix.Native.Syscall.kill (Process.GetCurrentProcess ().Id, Mono.Unix.Native.Signum.SIGPROF); } } -- 2.11.4.GIT