-
Notifications
You must be signed in to change notification settings - Fork 50
Allocation failed - JavaScript heap out of memory #122
Comments
Thanks for reporting this. It is quite strange. Please upgrade NPM and NODE and let us know exactly which version of quasar you are running. |
Quasar CLI is v0.16 - the latest. Both global and local. I was surprised that I was getting such errors so I looked up what's latest for Quasar on GitHub only to find it was released 4 hours ago. 😄 I can upgrade to Node v8.11.2 since it's the last LTS. |
Ok, so I upgraded to Node v8.11.2 and NPM v6.0.1 and still managed to get that error by poking hard (switching back and forth between commits to trigger recompile). 😆 Since quasar-cli has grown into something bigger I can't really fiddle with webpack settings/plugins to test out different configurations. Putting this one here just for reference: btw I'm using Yarn. |
@danikane Are you importing massively large files, doing stuff with breakpoints / styl ? |
Nope, just a regular barebone Quasar project with:
I just edited the index.vue page. The very same configuration I have always used for a new project. I guess this issue hasn't gained much attention yet because people are still on 0.15. |
This is a webpack or a webpack-loader/plugin issue. Quasar CLI is not at fault here. Note that Quasar CLI v0.16 jumped to using webpack 4. |
@rstoenescu That's exactly what I'm saying. :) I also think webpack 4 is the culprit here. Still Quasar CLI jumped on that wagon so I thought I'd let you know. I watched the node dev server process spiking up in CPU usage and the memory footprint increased. |
They suggest looking into adding the |
I'd say this one: |
Would you be so kind as to make one small test, pls? DO NOT run any npm/yarn commands after this change. |
Razvan, I still managed to crash it. 😢 I also commented it out completely, but crashed again. Remember, this is only on dev server, build passes ok, so right now this is minor inconvenience IMO. |
@danikane - Can you list all of the webpack plugins and babel loaders that you are using? |
Do a **quasar init ** with Quasar CLI v0.16 and you'll have them. |
framework: all, animations:all -> that might be the cause of the issue here. And you potentially might need to increase your memory available to node... |
All due respect, but I've always used framework: all, animations:all for development and never hit a snag. You are right, node's memory limit is by default ~1.76 GB on x64, I would increase it if I could, except it has to be passed as a flag to the node executable and I don't know where to do it. 😄 Theoretically even if I set it at 8 GB it would still hit the threshold at some point. BTW the projects starts at ~300 MB footprint. |
I am not trying to be disrespectful. :) But perhaps you remember the docs? framework: 'all'
|
Come on, man, I think I'm a reasonable and logical person. 😄 And I like to test thoroughly. I just tested a fresh clean vue project (I know, it's small, doesn't have a huge amount of dependancies) and observed the memory usage. Same as Quasar CLI v0.15 it uses Webpack 3 (3.6.0 to be specific). Memory usage never went above 250 megs just because ... it cleans up well after itself and actually gets as low as 130, just because ... memory management. I'm not trying to bash you, Razvan or the repo, just pointing out an issue, trying to contribute some way or the other. I still think some plugin doesn't play well with Webpack 4 and I still think you guys did and are still doing great job, so thanks again! |
This is the ENV var you can use as a temporary workaround until we resolve the issue properly: https://nodejs.org/dist/latest-v8.x/docs/api/cli.html#cli_node_options_options There are however issues with this: |
I just tested that like this: $ NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* npm run dev:pwa where dev:pwa is |
Over at the discord server several people have also reported this. |
Thanks, I set the env.variable. |
I wonder if this is our problem:
|
Yep, right:
|
https://github.com/stylus/stylus/blob/dev/package.json
|
Yes, a lot of commits since the last release, so we wait for a new release and update Quasar CLI's dependancies? |
Worst practice would be to remove the bad version of source-map in that library's node modules, and copy + paste a version from e.g. uglify-es/node_modules which I just did. And |
(and first compile is also a bit faster, I must say...) |
Yeah, but GLOBAL mode is not yet implemented. 😃 |
I'll leave GLOBAL for future work. And by the way, I actually used this on another project today and it worked perfectly. |
@danikane One more test please. Without any other temporary solutions in this thread, can you set quasar init then set quasar.conf > build > sourceMap: false and see if it still happens? Thank you for your efforts! |
Hey, glad to help! Another project eventually drops to the initial memory consumption. |
I was comparing the Sources tab on Chrome on two different projects and it seemed strange that the Vue file (from sourcemap) I'm editing doesn't get updated at all when updating the template (on the latest quasar compared to fresh vue project for example), only webpack hot update scripts get pushed. These are some of the dependancies of a pure vue project:
And these are quasar's:
But that's really black magic for me. 😄 Or maybe Vue team just didn't update their template. |
Just wanted to mention that dev server on my co-workers Mac sometimes randomly crashes for the same reason (Allocation failed, heap out of memory). |
@panstromek - have you tried this:
where dev:pwa is "dev:pwa": "quasar dev -m pwa", in package.json |
So this is still happening, btw. And now the following detail came to light on Discord: "I get that sometimes.. usually thanks to hot-reload in the middle of broken code being saved. Just restart quasar dev." I replied: " the interrupted hot-reload would explain this. The cache is not invalidated (GC'd) and won't be until webpack completes its run - so it just explodes and the node parent process can't allocate any more buffers because they're all full and locked." |
So it means it must be fixed within Webpack package and Quasar can't do anything about it. Opening a ticket on webpack or webpack-dev-server repository (with prior check if it's already there something similar) should be the way to go further. |
@rstoenescu - I opened an issue here about the source-map problem: stylus/stylus#2386 nothingismagick commented 7 days ago • @danikane |
|
@danikane can you update your node version to >= 10 and retry this? It seems like there would be a problem with node 8 only. Sorry for repeatedly asking to test. |
Hi! Did some testing of various configs related to this issue on pretty small project: ❌ Using node 10.0 did not fix the issue Honestly, I would appreciate possibility to disable PostCss in quasar.conf.js regardless - ran into some non-trivial problems introduced by PostCss on quasar 0.14 and needed to disable it. Workaround for people that want to try disabling PostCss now:
|
Ran into same problems. I confirm: use of node 10 didn’t fix the issue. Thanks @leo-buneev, will try your workaround. |
Sadly, disabling PostCss didn't fix the problem for me:
|
I have the latest versions of all packages and node.js but occasionally I have the same problems. |
@Eldar-X - can you be more specific about the situation surrounding your experience with this issue? Does it happen when a hot-reload is interrupted with new changes? |
Made a small change to Quasar CLI (will be available in 0.16.5), based on one comment from sokra: webpack/webpack#1914 (comment) I'm still not confident this fixes it. |
The link to the similar issue at vue is here: vuejs/vue-cli#1453 |
I'm suffering from this issue as well. I have noticed that the dev server will crash more often when editing css. Also it tends to recompile more slowly over time before finally crash. previous versions of quasar didn't have this issue. seems like a huge oversight from Webpack team? |
Hi, any updates on this? Tried all the workarounds suggested, but still getting this error when building on my cloud server:
|
@juanigonvocal - that is something else. This issue is about the dev server running out of memory. Your problem appears to be that the user cannot assign a thread to the node process. |
@nothingismagick yes, sorry I created #162 Thanks! |
Hey guys, let me report back after being away for quite some time. 😃
Soooo, I guess this could be considered case closed or at least for the v0.17.x CLI. |
Then by all means - close it! |
@skirankumar7 It's a tree of all installed packages (organized by dependencies) that contain |
Software version
OS: Windows 10 x64
Node: v8.9.4
NPM: v5.6.0
Any other software related to your bug:
What did you get as the error?
I just started a new Quasar project only and saw afterwards Quasar got an upgrade to 0.16.
Consistently getting the following in dev mode after few minutes of work with a fair number of code changes and subsequent recompiling from the dev server:
What were you expecting?
No errors.
What steps did you take, to get the error?
Nothing, just started a new quasar project as usual. quasar init etc...
Could be related to:
webpack/webpack#6389
I have 16 GB of RAM so memory was never an issue, maybe webpack 4 is hitting some treshold or just leaking memory.
The text was updated successfully, but these errors were encountered: