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
Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory #66
Comments
@naralasaimanoj please create minimum reproducible test repo |
Also encountered similar problem in project with a lot of async chunks. In my case build just doesnt finishing. Manually installing 1.3.0 version fixes build. Reproducible repo would be hard to build, because when reducing number of async modules by half or so the build is finishing. Looks like big numder of async modules is required. Try my best |
Somebody can create minimum reproducible test repo otherwise issue will be closed |
Seems that problem reproduces only with node@10. I tried it with node@12 — all works |
@7rulnik What is node@10? Latest? |
@evilebottnawi major version of node. So on 10.x.x it doesn't work |
@7rulnik can you provde reproducible test repo with instructions? |
Unfortunately, I can't. It's not so easy. I have about ~100 chunks and node target. |
@7rulnik maybe you can provide access to private project (email: sheo13666q @ gmail.com)? if necessary I can sign an NDA, reproducible test repo allow us to solve problem more fast |
@evilebottnawi sorry, but I believe it's not possible because I'm working in the bank and we have really strong security rules. So the main idea that you should have a lot of dynamic imports (in our case it's about 120). Maybe you can give me advice how to debug it? Also, I can provide snapshots from Chrome devtool like in this article |
@7rulnik any additional information will be great |
@7rulnik if it is memory leak, heap snapshot will be very useful, i can take a look on it if you will provide it and webpack version. |
I can just make +1 on this problem. We faced with same problem (same a lot of async chunks). However, we have just increased max old space size. Unfortunately, I don't work on that project now and can not help with investigation. |
@evilebottnawi @vankop hey guys I tried to make a repro — no luck here. Also, I tried to capture heap snapshots via inspect API — no luck here too. My mac just stuck when I was trying to capture it. But I did some research about node. So on node v12.0.0 I got this message:
It's different but seems that it's related to node internals. After that, I tried it with node v12.1.0 and it worked out. Also I noticed that it crashes on |
Finally, I managed how to make repro. |
At first look looks like generating source maps for I will take a deep look later. UPD: Is it ok for code
It looks like it could be one to one mapping here + it could be small optimization for |
I was not able to see the problem in your repo @7rulnik It runs fine, it even generates smaller SourceMaps files with 1.4.1 compared to 1.3.0. I tried with node
Totally possible, each node probably points to a different location in the original source code. |
Yes it crashes for me, I'm getting out of memory for default max old space size. I have pointed where it happens
but I don't know how to help you 😞 it looks like source mapping just cost a lot of RAM =( @sokra @evilebottnawi @7rulnik I can upload for you heap snapshots (before source nodes creation, after, after starting traversing source nodes and generating source map) if you want to. I have Node.js 11.13.0 |
Is it happens only on node@11? I recommend try to avoid using non stable (non LTS) versions of node, sometimes they have perf/memory regressions in non LTS release (sometimes in LTS too ) |
Ok I will try to run in Node.js 12 in docker (So it totally will not depend on environment) later evening today. |
I'm running on windows, maybe this is a OSX or linux only issue? |
@evilebottnawi it happens from 10.0.0 to 12.0.0 and fixed in 12.1.0 on macOS@10.14.6 |
win 10, node 10.15.3 terminal log
|
hmm... So to conclude this seem to be a fixed node.js bug/inefficiency that occurs in macOS with node < 12.1.0. I don't think it's worth trying to find and adding a workaround in source, as there are solutions (upgrade node, or increase memory) available. For performance reasons lastest node.js is recommended anyway. |
for me still works only with increased memory.
index.js
run with if setup Anyway looks like Node.js issue (if you don't have this problem) . Sorry for spam |
Have this problem on node 12.13.0. |
@alexander-akait |
We got report in webpack repo |
@alexander-akait When I use the latest version, memory leaks still occur, causing the process to exit abnormally. Environmental information$ yarn why webpack
yarn why v1.22.10
[1/4] 🤔 Why do we have the module "webpack"...?
[2/4] 🚚 Initialising dependency graph...
[3/4] 🔍 Finding dependency...
[4/4] 🚡 Calculating file sizes...
=> Found "webpack@5.26.3"
info Reasons this module exists
- "@ez#preset-web-react#@ez#plugin-platform-web" depends on it
- Hoisted from "@ez#preset-web-react#@ez#plugin-platform-web#webpack"
info Disk size without dependencies: "4.86MB"
info Disk size with unique dependencies: "11.07MB"
info Disk size with transitive dependencies: "22.33MB"
info Number of shared dependencies: 43
✨ Done in 0.62s.
Error Info
|
Leak in custom plugin |
Do you mean the problem with my own code? Can you teach me how to identify it?🙋 |
Experience 😄 Anyway if you provide reproducible example, I will look at this |
🤤 |
I also ran into this problem with Webpack@5.26.2. But I'm sorry that I can't provide a "reproducible test repo". Environmental information
Error Info
|
You still on |
@alexander-akait |
@liby Can you run |
|
Yep, you still on webpack v4, but we have v5 with a lot of fixes, also |
There are several issues:
|
I don't understand you |
@alexander-akait |
Okay, run |
@alexander-akait
|
As you can see you still on |
@alexander-akait More information:
Should we follow the version installed in the
|
Good question, we need to look at logic in |
@alexander-akait |
Feel free to feedback |
Is there any solution? I'm facing this problem right now |
Please run |
Here is the result @alexander-akait PS C:\Users\user\practice-project> npx webpack-cli info
stdout: '', |
oh, that is weird, looks bug in |
Can you please break it down? |
Hi, I've got the same problem with node v14.18.3 In my cse I was on a debian 11 server with 1 go of ram (and 2 Go of swap) and got the same problem. I've ran Hope can help |
Getting this error continously after upgrading the package to 1.4.1. No issues were observed in 1.3.0
applySourceMap.js file was added recently. what is going wrong here ?
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x353fb8d9e6e9
2: /* anonymous /(aka / anonymous */) [0x115ab165d461] [/node_modules/webpack-sources/lib/applySourceMap.js:~58] [pc=0xb41578f5e0d](this=0x2729fd7826f1 ,c...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x8dc510 node::Abort() [node]
2: 0x8dc55c [node]
3: 0xad9b5e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xad9d94 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xec7bf2 [node]
6: 0xec7cf8 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node]
7: 0xed3dd2 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
8: 0xed4704 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
9: 0xed7371 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
10: 0xea6fbb v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [node]
11: 0xff08b3 v8::internal::String::SlowFlatten(v8::internal::Handlev8::internal::ConsString, v8::internal::PretenureFlag) [node]
12: 0xad7184 v8::internal::String::Flatten(v8::internal::Handlev8::internal::String, v8::internal::PretenureFlag) [node]
13: 0xff1a1e v8::internal::StringTable::LookupString(v8::internal::Isolate*, v8::internal::Handlev8::internal::String) [node]
14: 0x1169f18 v8::internal::Runtime_HasProperty(int, v8::internal::Object**, v8::internal::Isolate*) [node]
15: 0xb41561dbe1d
npm ERR! code ELIFECYCLE
The text was updated successfully, but these errors were encountered: