Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Crash #54

Open
martinlevesque opened this issue Sep 5, 2017 · 2 comments
Open

Crash #54

martinlevesque opened this issue Sep 5, 2017 · 2 comments

Comments

@martinlevesque
Copy link

martinlevesque commented Sep 5, 2017

I am sometimes getting the following js stack when it crashes:

--
==== JS stack trace =========================================

Security context: 0x1eebfa29cca1
1: indexOf(this=0x8003cb8acb9 <Very long string[120432959]>)
2: cssmin [/home/1/www/node_modules/cssmin/cssmin.js:~28] [pc=0x30c7f5977e84](this=0x3443744b0189 ,css=0x2bd8de31baa9 <Very long string[20809655]>,linebreakpos=0x1eebfa282241 )
3: arguments adaptor frame: 1->2
5: /* anonymous */ [/home/1/www/node_modules/express-minify/minifier....

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

--

any idea how to fix it?

I am using express-minify 0.2.0. I see there were new versions - is this issue known/fixed?

thanks

@breezewish
Copy link
Owner

breezewish commented Sep 6, 2017

Hi, this is out of memory error. Your application hit the default Nodejs memory limit and it crashed. This may caused by several issues, for example,

  1. There might be a memory leak in cssmin or uglifyjs
  2. You are serving a big file so that cssmin or uglifyjs needs large amount of memory to do minification
  3. You are not using disk cache so that express-minify keeps a lot of content in memory

Ways to solve:

  1. Make sure you enabled disk cache
  2. You can adjust NodeJs start up arguments to allow NodeJs using more memory
  3. Update express-minify to use latest version of those minifiers (and hope those new versions have less memory leaks)

@martinlevesque
Copy link
Author

Hi,

Thanks for the response. I will try your potential solutions. I already tried to increase max-old-space-size but without success.

I disabled temporarily the minification to avoid crashing, as I have several other things to do currently. I will report whenever I get back to it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants