Postcss out of memory when it is parsing many files
See original GitHub issueBasically postcss parse and keep in memory every file passed by grunt blob and it parse until breaking and goes out of memory.
example:
grunt.initConfig({
postcss: {
options: {
processors: [
require('autoprefixer')({browsers: 'last 2 versions'})
]
},
dist: {
src: 'css/*.css' // 50 css file with 20.000 line of css
}
}
});
error message I see in console:
<--- Last few GCs --->
69906 ms: Scavenge 1397.3 (1458.2) -> 1397.3 (1458.2) MB, 0.9 / 0 ms (+ 1.0 ms in 1 steps since last GC) [allocation failure] [incremental marking delaying mark-sweep].
70766 ms: Mark-sweep 1397.3 (1458.2) -> 1390.5 (1458.2) MB, 860.2 / 0 ms (+ 1.0 ms in 1 steps since start of marking, biggest step 1.0 ms) [last resort gc].
71601 ms: Mark-sweep 1390.5 (1458.2) -> 1392.3 (1458.2) MB, 834.5 / 0 ms [last resort gc].
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 00000348E1AB4639 <JS Object>
1: spacesFromStart [C:\projects\matteo-project\node_modules\postcss\lib\parser.js:~401] [pc=000001F0D87ADC63] (this=0000020F9DD924E9 <a ScssParser with map 00000322811F6AF9>,tokens=00000247023BD939 <JS Array[9]>)
2: decl [C:\projects\matteo-project\node_modules\postcss\lib\parser.js:235] [pc=000001F0D8906DCC] (this=0000020F9DD924E9 <a ScssParser with map 00000322811F6AF9>,tokens=000002470...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (17 by maintainers)
Top Results From Across the Web
postcss/postcss - Gitter
Hello all! When using postcss-loader I'm getting "FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory" My css files seem to ......
Read more >Getting Postcss warning without using it - Stack Overflow
I know why I'm getting the error (I don't have a Postcss config file or any plugins, stringifiers, etc, set) but I don't...
Read more >postcss-values-parser - npm
A CSS property value parser for use with PostCSS, following the same node, container, and traversal patterns as PostCSS.
Read more >postcss@8.3.5 | Deno
Fixed ReDoS vulnerabilities in source map parsing (by Yeting Li). ... Fix TypeScript definitions for case of multiple PostCSS versions in node_modules (by ......
Read more >Untitled
7.0.6 * Fix parsing files with BOM (by Veniamin Krol). ... 6.0.13 * Fix TypeScript definitions for case of multiple PostCSS versions in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@VitaliyR could you please create a issue in source-map with full stacktrace and your project description. Also maybe you should give them one file with source map to investigation.
If problem came from this library they will know more how to fix it.
@VitaliyR OK, let’s wait for
source-map
authors help. I just use their API and don’t know internal structure to help in this case.