From e1d49821fdc472dfd786a7c63b8b8f9752087ae2 Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Mon, 20 Jun 2016 03:53:01 -0700 Subject: [PATCH] Fix minor heap size calculation Summary: The code to set the minor heap size confused bytes and words, and so was off by a factor 8. Fortunately it attempted to set the minor heap to 1MB and got the better value of 8MB instead. Reviewed By: cristianoc Differential Revision: D3455937 fbshipit-source-id: 48d0e23 --- infer/src/backend/config.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/infer/src/backend/config.ml b/infer/src/backend/config.ml index 8beccef67..4ce8f9650 100644 --- a/infer/src/backend/config.ml +++ b/infer/src/backend/config.ml @@ -1074,11 +1074,11 @@ let post_parsing_initialization () = let set_minor_heap_size nMb = (* increase the minor heap size to speed up gc *) let ctrl = Gc.get () in - let oneMb = 1048576 in - let new_size = max ctrl.Gc.minor_heap_size (nMb * oneMb) - in Gc.set { ctrl with Gc.minor_heap_size = new_size } + let words_of_Mb nMb = nMb * 1024 * 1024 * 8 / Sys.word_size in + let new_size = max ctrl.Gc.minor_heap_size (words_of_Mb nMb) in + Gc.set { ctrl with Gc.minor_heap_size = new_size } in - set_minor_heap_size 1 ; + set_minor_heap_size 8 ; let symops_timeout, seconds_timeout = let default_symops_timeout = 333 in