sass / sassc-ruby

Use libsass with Ruby!
MIT License
367 stars 156 forks source link

JavaScript heap out of memory #228

Closed sylvainbx closed 2 years ago

sylvainbx commented 2 years ago

We recently update sassc from 2.2.1 to 2.4.0 to fix #146 It worked fine but a new issue appeared since then that I suspect to be related to sassc.

When we build the assets of our project on computers with 2 Gb of RAM, the compilation fails with one of the following error message:

<--- Last few GCs --->
[56:0x7f30929e52a0]   490833 ms: Mark-sweep (reduce) 995.6 (1002.6) -> 994.9 (1004.1) MB, 2029.7 / 0.0 ms  (average mu = 0.089, current mu = 0.023) allocation failure scavenge might not succeed

<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

The compilation succeed on computers with 4 Gb of RAM. Previously, using sassc 2.2.1 we had no issues with only 2 Gb of memory.

Steps to reproduce :

run this script on a computer with 2 Gb of available memory, it will fail during the assets compilation phase.

ahorek commented 2 years ago

the error comes from some JavaScript engine (I guess it could be a js minifier / parser?). This gem uses C extensions, but it has nothing to do with JavaScript, so I think the problem lies elsewhere.

sylvainbx commented 2 years ago

Ok thanks for your reply, I will check on that side.