RAM usage is lower after a server reboot
-
After installing a bunch of apps in the recent weeks, my server has been idling at 3GB RAM. I got a server notification for a reboot last night and I did that around the time you can see where the server RAM dips down to around 1.5GB. Since the reboot, the server has been idling at 2GB instead. Anyone else experienced something similar?
I tried to check the logs (app, backup, etc.) and I couldn't go back more than a few hours for some or couple of days for other logs.
The CPU usage has been steady and consistent this whole time.
-
@girish On an unrelated note, I've been compressing images before uploading to the forum. For future uploads, should I keep doing that or does NodeBB have this functionality built-in?
-
@humptydumpty The forum will compress it. I think it doesn't let you upload very large images, but otherwise NodeBB would scale it down as required.
As for the original question, I think this is expected. If you leave a program running, it will consume memory over time. This is not just because of memory leaks but the app simply thinks there is no reason to actively free memory. Ruby/Python/Node apps are all guilty of this. In fact, it's one of the reasons to run apps in containers. If you give these frameworks/languages lot of memory, they just hog a lot of memory even when idling. (Essentially most dynamic languages will start with a "heap" and keep allocating till it hits the limit and won't gc them unless they get a memory allocation failure).
-
To add to this, the linux kernel also "buffers/caches" (free -m) a lot when no other apps are using memory. This will appear as used in the graphs but apps can always claim this memory when they want it. See also https://serverfault.com/questions/85470/meaning-of-the-buffers-cache-line-in-the-output-of-free