diff options
Diffstat (limited to 'rts/sm/GC.c')
-rw-r--r-- | rts/sm/GC.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/rts/sm/GC.c b/rts/sm/GC.c index a97042c718..6be81e5ff0 100644 --- a/rts/sm/GC.c +++ b/rts/sm/GC.c @@ -268,6 +268,18 @@ GarbageCollect (uint32_t collect_gen, /* See Note [Deadlock detection under nonmoving collector]. */ deadlock_detect_gc = deadlock_detect; +#if defined(THREADED_RTS) + if (major_gc && RtsFlags.GcFlags.useNonmoving && concurrent_coll_running) { + /* If there is already a concurrent major collection running then + * there is no benefit to starting another. + * TODO: Catch heap-size runaway. + */ + N--; + collect_gen--; + major_gc = false; + } +#endif + /* N.B. The nonmoving collector works a bit differently. See * Note [Static objects under the nonmoving collector]. */ |