NodeJs (Nest) memory increasing

rpuig2001
HOBBY

9 months ago

After deploying my app, the memory has a continuous increase of memory:
https://gyazo.com/10893b31756dc0be5e73f902576d6e03

I tried to null all my obejcts and variables after using, but the issue is still there…
Any idea?

0 Replies

rpuig2001
HOBBY

9 months ago

84834faa-629f-4eee-a90d-be5a7c6b698d


That's how JavaScript garbage control works. Eventually you will see the ram usage drop and climb again


rpuig2001
HOBBY

9 months ago

Thank you @TurboFarmer9000, is there any way to control it? Unfortunately memory usage affects directly to the service cost 😦


9 months ago

Since it's javascript, not much, but give this a try:
-> Make sure you're running in prod mode
-> See if Nest has some configs to help on that

I would also suggest optimizing code but tbh this is primarly how node works, it's gonna use a fair bit of ram one way or another

The best way to reduce usage is migrating from JS lmao, for example there's a guy running a Go server with the 5usd free trial using 16mb, it will run for aprox. 2 years for free lmfao


rpuig2001
HOBBY

9 months ago

Thanks a lot!


NodeJs (Nest) memory increasing - Railway Help Station