Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run garbage collection once when the main process is waiting for #5396

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Sep 25, 2024

  1. Run garbage collection once when the main process is waiting for

    In ocaml#5376, @dra27 suggested running `Gc.compact` when the main
    process is waiting for the children processes for the first time.
    
    > what I was thinking here was that possibly at the point where opamProcess first is going to wait
    > for the completion of running jobs, we could add a Gc.compact?
    
    In my local running on `opam install ppxlib`, "GC compact" ran in the middle of parallel processing
    of actions.
    
    ```
    The following actions will be performed:
    === install 1 package
      ∗ ppxlib 0.28.0
    00:07.216  XSYS                            Adding to env { LC_ALL=C }
    00:09.099  STATE                           depexts loaded in 1.883s
    00:09.100  SOLUTION                        parallel_apply
    00:09.100  SOLUTION                        Regroup shared source packages: {}
    
    <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
    00:09.106  PARALLEL                        Iterate over 3 task(s) with 11 process(es)
    00:09.106  PARALLEL                        Starting job 444950918 (worker -/11 -/1 1/3): ⬇ ppxlib.0.28.0
    00:09.106  SOLUTION                        Fetching sources for ppxlib.0.28.0
    00:09.106  ACTION                          download_package: ppxlib.0.28.0
    00:09.106  SYSTEM                          rmdir /Users/scho/.opam/4.14.0/.opam-switch/sources/ppxlib.0.28.0
    00:09.109  SYSTEM                          mkdir /var/folders/gx/6809fgsd3nndyyf69y3h12_h0000gn/T/opam-14220-67d907
    00:09.110  PARALLEL                        Next task in job 444950918: /usr/bin/tar xfj /Users/scho/.opam/download-cache/sha256/d8/d87ae5f9a081206308ca964809b50a66aeb8e83d254801e8b9675448b60cf377 -C /var/folders/gx/6809fgsd3nndyyf69y3h12_h0000gn/T/opam-14220-67d907
    00:09.619  PARALLEL                        GC compact (heap 490 MB -> 328 MB)
    00:09.619  PARALLEL                        Collected task for job 444950918 (ret:0)
    00:10.158  SYSTEM                          rmdir /var/folders/gx/6809fgsd3nndyyf69y3h12_h0000gn/T/opam-14220-67d907
    ⬇ retrieved ppxlib.0.28.0  (cached)
    00:10.321  PARALLEL                        Job 444950918 finished
    ```
    
    Similar to ocaml#5376, this PR enabled my 1GB-RAM machine to install `ppxlib` or `js_of_ocaml` without OOM.
    kkeundotnet authored and kit-ty-kate committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    9602214 View commit details
    Browse the repository at this point in the history