Skip to content
Snippets Groups Projects
Commit edbf51ab authored by Ben Gamari's avatar Ben Gamari Committed by Austin Seipp
Browse files

rts: Set default maximum stack size to 80% of physical memory

parent bcc337aa
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@
#include "RtsUtils.h"
#include "Profiling.h"
#include "RtsFlags.h"
#include "sm/OSMem.h"
#ifdef HAVE_CTYPE_H
#include <ctype.h>
......@@ -93,10 +94,15 @@ static void errorRtsOptsDisabled(HsBool is_hs_main, const char *s);
void initRtsFlagsDefaults(void)
{
StgWord64 maxStkSize = 8 * getPhysicalMemorySize() / 10;
// if getPhysicalMemorySize fails just move along with an 8MB limit
if (maxStkSize == 0)
maxStkSize = (8 * 1024 * 1024) / sizeof(W_);
RtsFlags.GcFlags.statsFile = NULL;
RtsFlags.GcFlags.giveStats = NO_GC_STATS;
RtsFlags.GcFlags.maxStkSize = (8 * 1024 * 1024) / sizeof(W_);
RtsFlags.GcFlags.maxStkSize = maxStkSize;
RtsFlags.GcFlags.initialStkSize = 1024 / sizeof(W_);
RtsFlags.GcFlags.stkChunkSize = (32 * 1024) / sizeof(W_);
RtsFlags.GcFlags.stkChunkBufferSize = (1 * 1024) / sizeof(W_);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment