Closed Cooya closed 3 months ago
Can you share example code to reproduce the crash @Cooya
I wish I could reproduce the crash.
PTAL #4178
Also check https://github.com/nodejs/help/issues/3425. There is a link to a stack overflow ticket on that issue which lists out some approaches
Thank you for your help.
I am starting to think the issue has nothing to do with regular expressions but it is more of a NodeJS problem. When the crash occurs, the heap size is about 300MB whereas the maxium heap size is about 4GB. It should not trigger a out of memory error because the process has still plenty of space in the heap.
At the end of last July, I upgraded my version of NodeJS from 18.16 to 18.17 and I wonder if the issue did not start to occur after this upgrade. I am trying a downgrade to 18.16 to see if the process stops crashing.
Okay. Please take a look at change log https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#18.17.1
It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.
The issue has been resolved with the upgrade to NodeJS v20.11.0.
Details
I have been struggling for quite some time with app crashes due to regular expressions. The error is the following :
I have tried to set NODE_OPTIONS="--max-old-space-size=2048" but it has no effect. My script is using dozens of regular expressions, some of them are quite complex, but I cannot put a finger on the one that triggers the memory crash and I am not sure there is one regular expression in particular causing the issue. I tried to wrap the methods related to regular expressions (new RegExp, RegExp.exec(), String.match(), String.matchAll(), String.replace() and String.split()) to log the last regular expression used before the process crashes, but nothing conclusive. I tried as well to simplify the more complex regular expressions in my code, but the issue is still persisting. The crash is hard to reproduce as it happens every few hours of running in production.
Any idea on how to determine the origin of the issue ?
Node.js version
v18.17.0
Example code
No response
Operating system
Ubuntu 20.04.5 LTS
Scope
Not applicable.
Module and version
Not applicable.