Skip to content

Instantly share code, notes, and snippets.

@ThomasG77
Created September 15, 2016 23:37

Revisions

  1. ThomasG77 created this gist Sep 15, 2016.
    23 changes: 23 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    # Syndrom: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

    ## When?

    Doing an `npm search whatever`, npm tries to make indexing works.

    It returns the "syndrom" message and as I'm using NVM a path like below referencing how npm has been called.

    ```
    ...
    argv "/home/myuser/.nvm/versions/node/v6.2.2/bin/node" "/home/myuser/.nvm/versions/node/v6.2.2/bin/npm"
    ...
    ```

    ## A solution

    The solution for me was taking `"/home/myuser/.nvm/versions/node/v6.2.2/bin/node" "/home/myuser/.nvm/versions/node/v6.2.2/bin/npm"` and then upgrade the call with node additional options like below:

    ```
    "/home/myuser/.nvm/versions/node/v6.2.2/bin/node" --max_old_space_size=4096 --optimize_for_size --max_executable_size=4096 --stack_size=4096 "/home/myuser/.nvm/versions/node/v6.2.2/bin/npm" search whatever
    ```

    As my configuration is 8GB of RAM on an Ubuntu x64, you may change value 4096