summaryrefslogtreecommitdiff
path: root/rts/sm/Storage.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2016-04-24 21:31:55 +0100
committerSimon Marlow <smarlow@fb.com>2016-05-04 05:30:30 -0700
commitf703fd6b50f0ae58bc5f5ddb927a2ce28eeaddf6 (patch)
tree354f1ae4f9dd047c2f1f12f25e00d34ee7797e30 /rts/sm/Storage.c
parent76ee260778991367b8dbf07ecf7afd31f826c824 (diff)
downloadhaskell-f703fd6b50f0ae58bc5f5ddb927a2ce28eeaddf6.tar.gz
Add +RTS -AL<size>
+RTS -AL<size> controls the total size of large objects that can be allocated before a GC is triggered. Previously this was always just the value of -A, and the limit mainly existed to prevent runaway allocation in pathalogical programs that allocate a lot of large objects. However, since the limit is shared between all cores, on a large multicore the default becomes more restrictive, and can end up triggering GC well before it would normally have been. Arguably a better default would be A*N, but this is probably excessive. Adding a flag lets you choose, and I've left the default as it was. See docs for usage.
Diffstat (limited to 'rts/sm/Storage.c')
-rw-r--r--rts/sm/Storage.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c
index 18ae796864..3e421a6e9b 100644
--- a/rts/sm/Storage.c
+++ b/rts/sm/Storage.c
@@ -179,8 +179,11 @@ initStorage (void)
debug_caf_list = (StgIndStatic*)END_OF_CAF_LIST;
revertible_caf_list = (StgIndStatic*)END_OF_CAF_LIST;
- /* initialise the allocate() interface */
- large_alloc_lim = RtsFlags.GcFlags.minAllocAreaSize * BLOCK_SIZE_W;
+ if (RtsFlags.GcFlags.largeAllocLim > 0) {
+ large_alloc_lim = RtsFlags.GcFlags.largeAllocLim * BLOCK_SIZE_W;
+ } else {
+ large_alloc_lim = RtsFlags.GcFlags.minAllocAreaSize * BLOCK_SIZE_W;
+ }
exec_block = NULL;