You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
flambda-backend: Attempt to shrink the heap before calling the assembler (ocaml#429)
* Attempt to shrink the heap before calling the assembler
We have a fair amount of global state that's never collected, which is causing
trouble in large parallel builds, particularly when large assembly files are
generated, causing `as` to need a lot of memory itself. This patch simply clears
out some data once it's no longer needed and, when memory use is high, calls
`Gc.compact` to try and release some memory back to the OS. This has been
observed to reduce the heap size by some 640MB (for an unusually large generated
.ml file).
This PR still leaves some relatively low-hanging fruit: after to_cmm, we can
marshal the .cmx eagerly and clear out the exported info. However, it's not
obvious how to handle this cleanly, and anyway one can use `-Oclassic` to avoid
producing a large .cmx to begin with.
0 commit comments