When the we do next start
we get this error,
This is a sample stack trace:
info - Loaded env from /app/.env
Listening on port 3009
<--- Last few GCs --->
[1:0x7fd1df6e8330] 41527 ms: Mark-sweep (reduce) 497.4 (509.4) -> 497.1 (510.2) MB, 1868.8 / 0.1 ms (average mu = 0.063, current mu = 0.001) allocation failure scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
For more context: we run our next 12
project in a docker env and this is deployed by kubernetes
also as a temporary fix i have increased memory allocation using -max-old-space-size
flag
initial memory usage – 500MB, increased memory to 2.5 GB
but as we started monitoring memory usage when server starts it drops down to 200-300 MB
why that might be happening, pls explain