Deployed a Node JS Micro Service on predix with 512 MB Memory and 1 GB Disk config. In 7 days memory usage increased from 35 MB to 160 MB without making any code execute except that the service is running and http server keep listening on a port.
New Relic says that heap is not increasing. Not sure why memory keeps increasing and after certain days, micro service restarts after throwing "Error Code 137" and message "Out Of Memory".
Any help is appreciated.
Answer by ganesh.vaithilingam@ge.com · Jul 07, 2020 at 10:10 AM
What is the version of Node module?
Are you monitoring the resident set size as well?
You may need to apply NODE_OPTIONS: --max-old-space-size=<> to make the node aware of the upper limit of the container memory.
Node version is 8.16.1
As predix doesn't support cflinuxfs3 stack, max version available in node js buildpack #v1.6.56 is node 8.16.1 in 8.x series and node 10.15.0 in 10.x series.
Regarding NODE_OPTIONS: --max-old-space-size=<>, When I set this value to be around 75% of app memory limit, it still throws memory error(though it was from node process instead), and when app reaches this limit, longer GC cycles is happening.
Not sure how can I monitor resident set size in predix.