Put the "degraded allocation" warning behind a log level.
authorAlex Rønne Petersen <alexrp@xamarin.com>
Thu, 1 May 2014 15:25:07 +0000 (17:25 +0200)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Thu, 1 May 2014 15:25:07 +0000 (17:25 +0200)
We generally shouldn't print stuff to stdout/stderr unless we're
about to fatally crash or something.

mono/metadata/sgen-alloc.c

index 02a1d45bd34dd834bb7c03717fe094fd9ca53bab..6f2909769abb92dfe9aba4a1f5ed2f1433743b94 100644 (file)
@@ -120,9 +120,9 @@ alloc_degraded (MonoVTable *vtable, size_t size, gboolean for_mature)
                if (last_major_gc_warned < stat_major_gcs) {
                        ++num_degraded;
                        if (num_degraded == 1 || num_degraded == 3)
-                               fprintf (stderr, "Warning: Degraded allocation.  Consider increasing nursery-size if the warning persists.\n");
+                               mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "Warning: Degraded allocation.  Consider increasing nursery-size if the warning persists.");
                        else if (num_degraded == 10)
-                               fprintf (stderr, "Warning: Repeated degraded allocation.  Consider increasing nursery-size.\n");
+                               mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "Warning: Repeated degraded allocation.  Consider increasing nursery-size.");
                        last_major_gc_warned = stat_major_gcs;
                }
                InterlockedExchangeAdd (&degraded_mode, size);