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

jupyter lab build consistently failing due to "FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory" error #4325

Closed
gnestor opened this issue Apr 5, 2018 · 9 comments
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. tag:Build System
Milestone

Comments

@gnestor
Copy link
Contributor

gnestor commented Apr 5, 2018

[LabBuildApp] > node /Users/grant/Sites/jupyter/jupyterlab/jupyterlab/staging/yarn.js run build:prod
yarn run v1.5.1
$ webpack --config webpack.prod.config.js

<--- Last few GCs --->

[88208:0x103001a00]   122153 ms: Mark-sweep 1403.3 (1472.8) -> 1403.3 (1445.8) MB, 1875.5 / 0.0 ms  (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 1876 ms) last resort GC in old space requested
[88208:0x103001a00]   123778 ms: Mark-sweep 1403.3 (1445.8) -> 1403.3 (1445.8) MB, 1624.3 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x3298f8525ec1 <JSObject>
    1: SourceMapGenerator_addMapping [/Users/grant/anaconda/share/jupyter/lab/staging/node_modules/uglify-es/node_modules/source-map/lib/source-map-generator.js:~103] [pc=0x28683eb7daab](this=0x3298b8ab5721 <SourceMapGenerator map = 0x3298474bf191>,aArgs=0x3298dd4a7de9 <Object map = 0x32984749f581>)
    2: add [0x3298db682311 <undefined>:~13790] [pc=0x28683eb84e51](this=0x32986a416c19 <Object ma...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/usr/local/bin/iojs]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/usr/local/bin/iojs]
 3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/bin/iojs]
 4: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/usr/local/bin/iojs]
 5: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/iojs]
 6: 0x28683e90463d
 7: 0x28683eb7daab
 8: 0x28683eb84e51
 9: 0x28683eb87f2e
@gnestor
Copy link
Contributor Author

gnestor commented Apr 17, 2018

I've observed that this can be avoided by using the --dev flag when running jupyter lab build.

@jasongrout
Copy link
Contributor

You can also increase the memory allocation for node by setting this environment variable:

export NODE_OPTIONS=--max-old-space-size=4096

@jasongrout
Copy link
Contributor

(This happened to me when I had a huge js file in a plugin. Separating out the js file helped.)

@gnestor
Copy link
Contributor Author

gnestor commented Apr 17, 2018

Thanks @jasongrout!

@gnestor
Copy link
Contributor Author

gnestor commented May 24, 2018

I have installed MANY labextensions and I may have hit the limit of what our webpack build can handle. Using NODE_OPTIONS=--max-old-space-size=8192 jupyter lab build (from what I can tell, 8192 is the max) consistently fails with a CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory error. I am able to workaround this with NODE_OPTIONS=--max-old-space-size=8192 jupyter lab --watch.

Here's my list of installed labextensions:

$ jupyter labextension list
JupyterLab v0.32.0
Known labextensions:
   app dir: /Users/grant/anaconda/share/jupyter/lab
@hadim/jupyterlab_gist
        @hadim/jupyterlab_gist v0.3.1  enabled  OK*
@jupyter-widgets/jupyterlab-manager
        @jupyter-widgets/jupyterlab-manager v0.35.0  enabled  OK
@jupyterlab/facets-extension
        @jupyterlab/facets-extension v0.16.0 disabled OK
@jupyterlab/fasta-extension
        @jupyterlab/fasta-extension v0.16.0  enabled  OK*
@jupyterlab/geojson-extension
        @jupyterlab/geojson-extension v0.16.0  enabled  OK*
@jupyterlab/github
        @jupyterlab/github v0.6.0  enabled  OK
@jupyterlab/google-drive
        @jupyterlab/google-drive v0.12.0  enabled  OK
@jupyterlab/katex-extension
        @jupyterlab/katex-extension v0.16.0  enabled  OK*
@jupyterlab/plotly-extension
        @jupyterlab/plotly-extension v0.16.0  enabled  OK*
@jupyterlab/vdom-experimental-extension
        @jupyterlab/vdom-experimental-extension v0.15.7  enabled  OK*
@jupyterlab/vega2-extension
        @jupyterlab/vega2-extension v0.16.0  enabled  OK*
jupyterlab-chart-editor
        jupyterlab-chart-editor v0.2.0  enabled  OK*
jupyterlab-kernelspy
        jupyterlab-kernelspy v0.1.3  enabled  OK
jupyterlab-monaco
        jupyterlab-monaco v0.1.0  enabled  OK*
jupyterlab-toc
        jupyterlab-toc v0.2.1  enabled  OK
jupyterlab_voyager
        jupyterlab_voyager v0.1.0  enabled  OK*
nbdime-jupyterlab
        nbdime-jupyterlab v0.2.0  enabled  OK
qgrid
        qgrid v1.0.1  enabled  OK

@jasongrout
Copy link
Contributor

Can you try --trace-gc-verbose (from https://stackoverflow.com/questions/16586705/configuring-v8s-memory-management-to-be-smart-for-a-node-js-process) to see if we can figure out what the memory situation looks like?

@ThatAIGeek
Copy link

So what's the state of this problem? Just experienced it with 0.33.11

@blink1073
Copy link
Member

0.34 uses dev_mode by default. We have an rc out now, final release is today.

@saulshanabrook
Copy link
Member

Closing this since we use dev_mode by default now in 0.34 and that should hopefully fix this

@saulshanabrook saulshanabrook modified the milestones: Reference, 0.34 Sep 10, 2018
@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Aug 8, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. tag:Build System
Projects
None yet
Development

No branches or pull requests

5 participants