FullHuman / purgecss

Remove unused CSS
https://purgecss.com
MIT License
7.8k stars 248 forks source link

Heap Memory Exceeded Limit using Yarn to install #700

Closed teekenl closed 1 year ago

teekenl commented 3 years ago

Describe the bug Got into memory exceeded limit error when trying to install the plugin using yarn

To Reproduce Steps to reproduce the behavior:

  1. Go to terminal - install
  2. Run yarn add purgecss-webpack-plugin
  3. See error

Note: have tried the following:

  1. export NODE_OPTIONS= --max_old_space_size=16000

Expected behavior should install successfully

Screenshots

❯ yarn add purgecss-webpack-plugin                
yarn add v1.22.10
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
[4/5] 🔗  Linking dependencies...
warning " > extract-text-webpack-plugin@3.0.2" has incorrect peer dependency "webpack@^3.1.0".
warning " > webpack-manifest-plugin@1.3.2" has incorrect peer dependency "webpack@1 || 2 || 3".
<--- Last few GCs --->
[1585:0x1046ab000]   934298 ms: Scavenge (reduce) 15963.4 (16020.1) -> 15963.0 (16020.6) MB, 27.0 / 0.0 ms  (average mu = 0.278, current mu = 0.207) allocation failure 
[1585:0x1046ab000]   934322 ms: Scavenge (reduce) 15963.7 (16017.6) -> 15963.3 (16018.9) MB, 21.4 / 0.0 ms  (average mu = 0.278, current mu = 0.207) allocation failure 
[1585:0x1046ab000]   934345 ms: Scavenge (reduce) 15964.0 (16020.9) -> 15963.7 (16021.4) MB, 20.4 / 0.0 ms  (average mu = 0.278, current mu = 0.207) allocation failure 
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x1012d96a5 node::Abort() (.cold.1) 
 2: v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) 
 3: 0x100395df5 v8::internal::Heap::FatalProcessOutOfMemory(char const*)
 4: 0x10039789a v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) 

Environment (please complete the following information):

Ffloriel commented 3 years ago

This is more likely an issue with yarn itself. Does it happen only when trying to add this plugin? If you try to install other webpack plugins, you don't see the same result?

If the issue is only with PurgeCSS plugin, could you provide a repository to reproduce this issue?

teekenl commented 3 years ago

@Ffloriel thanks for the quick response! It happened even when you installed it with npm. And yes, it only happened when trying to add this. This is my very basic repo https://github.com/teekenl/test-purge-css, so if you pulled down and run yarn install before trying to run yarn add purgecss-webpack-plugin you will get the error.

ravi-magecroco commented 3 years ago

Hey @teekenl - did you ever find the solution?

cc @Ffloriel

Ffloriel commented 3 years ago

https://github.com/yarnpkg/yarn/issues/6511

Ffloriel commented 1 year ago

Unsure if it's because of a new version of Yarn but the issue seems to not happen anymore in https://github.com/teekenl/test-purge-css