Fail hard if initial heap size is too large
commit0ccff58cb7c0007c2e7f51c9e826100ce2189fef
authorJez Ng <jezng@fb.com>
Sat, 30 May 2015 10:34:24 +0000 (30 03:34 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Sat, 30 May 2015 11:00:37 +0000 (30 04:00 -0700)
tree4faa6a263f8aa30fef9d2ed1fc21f39f3fcfc951
parent4d2732adb78fd02d70c34a8065d372cdbb36464d
Fail hard if initial heap size is too large

Summary: So it turns out that the heap overflow problem hit harder than I'd
thought. The issue was that we would GC only in the heap size doubled
from the initial size after server startup. That meant that when our
code took more than half the total heap size after startup, the GC would
*never* run!

I could've worked around this by relaxing the condition for collection,
but I figure it's better to fail early and hard than to slow down
gradually or fail unpredictably. If we're at more than half the total
heap size after startup, there's a good chance that some rebase would
cause the heap to overflow before the garbage collection gets invoked.

Reviewed By: @jwatzman

Differential Revision: D2102019
hphp/hack/src/heap/hh_shared.c
hphp/hack/src/heap/sharedMem.ml
hphp/hack/src/stubs/eventLogger.ml