[Pkg-javascript-devel] Bug#956211: Bug#956211: nodejs 10 segfaults when running webpack on gitlab 12.9.2 - FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Pirate Praveen
praveen at onenetbeyond.org
Fri Apr 10 18:41:20 BST 2020
Control: tag -1 help
On Wed, Apr 8, 2020 at 4:08 pm, Jérémy Lal <kapouer at melix.org> wrote:
> Tags: wontfix
>
> Le mer. 8 avr. 2020 à 15:48, Pirate Praveen
> <praveen at onenetbeyond.org> a écrit :
>> Package: nodejs
>> Version: 10.19.0~dfsg-3
>> Severity: grave
>> Control: notfound -1 12.13.1~dfsg-1
>>
>>
>> nodejs 10 crashed (retried again) and on the same machine nodejs 12
>> worked.
>> This has been working upto gitlab 12.8.8 and the failure appeared
>> when
>> trying to update to 12.9.2 (just installing gitlab from
>> experimental in
>> an lxc container).
>
> This is a known issue with nodejs and high memory usage, which happen
> to be better with nodejs 12 (but only because gitlab assets
> compilation does
> not go way above 2GB usage).
>
> There is no way to fix it in general: you will always find use cases
> that make
> nodejs crash as soon as it is using GB of heap memory space.
>
> Any nodejs < 14 version is affected (because who knows, v8 might make
> it
> possible for node to fix it in nodejs 14) but not in the same way
> (some fail at 1.4GB,
> others at 2GB of heap space usage).
>
> You can try running it with this flag:
> webpack --max-old-space-size=4096
>
> Note also that using a high value by default is not a good solution
> either.
>
Thanks for the answer. It may be possible to reduce memory usage by
excluding system libraries (in /usr/lib/nodejs, /usr/share/nodejs,
/usr/share/javascript) during transpiling (babel loader). Can someone
help me with the correct regex for doing it? All examples on the
internet shows excluding node_modules only.
Currently it is patched to exclude core-js from babel-loader,
test: /\.js$/,
exclude: [ path =>
/node_modules\/(?!tributejs)|node_modules|vendor[\\/]assets/.test(path)
&
&
!/\.vue\.js/.test(path),
/\bcore-js\b/,
/\bwebpack\/buildin\b/
],
loader: 'babel-loader',
I tried adding '/usr/share/nodejs' as string,
path.resolve('/usr/share/nodejs') but it did not seem to work.
> Jérémy
>
More information about the Pkg-javascript-devel
mailing list