How to fix javascript heap out of memory #399
-
Whenever I run npm run docs:build in my windows desktop it works fine but when I run it in my old desktop it throws this error.
So how to fix it? Edit: and Also what will happen when I will export 20000 pages? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
As per my discussion with @Mister-Hope 700 pages will require 8GB of ram. So probably 20000 pages will require too much ram, also can anyone confirm if we will limit like as @dtbj said he used node settings to use less ram so then will it export 20000 pages static site without the desired ram maybe by taking time or not???? |
Beta Was this translation helpful? Give feedback.
-
Obviously 1GB machine can not be used to build a front-end project like this. You cannot built even you are using webpack or vite directly with 20k routes having content. My point is, if you cannot built a project with this amount of pages redirectly on Vite and webpack, then the issue does not belong to vuepress. VuePress2 already makes great improvements in scalability, and in my case, it only takes less than one-third of memory comparing with VuePress1. Also, in my test case, a 5k pages project can be built with 4GB ram, that's already reasonable IMO. But, if you find possible memory leak, or you do have ideas reducing memory usage without taking more time, a bug report or new dicussion is always welcome. |
Beta Was this translation helpful? Give feedback.
-
I want to build a page with ~2k pages. Is this a webpack problem or how can we avoid that it eats so much memory |
Beta Was this translation helpful? Give feedback.
Obviously 1GB machine can not be used to build a front-end project like this. You cannot built even you are using webpack or vite directly with 20k routes having content.
My point is, if you cannot built a project with this amount of pages redirectly on Vite and webpack, then the issue does not belong to vuepress.
VuePress2 already makes great improvements in scalability, and in my case, it only takes less than one-third of memory comparing with VuePress1. Also, in my test case, a 5k pages project can be built with 4GB ram, that's already reasonable IMO.
But, if you find possible memory leak, or you do have ideas reducing memory usage without taking more time, a bug report or new dicussio…