Overtime, RAM goes away?

So I’m guessing I’m just not smart enough to grasp this, because i haven’t seen any other posts of this topic. But when I reboot my Server Box, it goes up to 32GB of RAM on the Control Panel, Starting each server as usual brings it down to about 20-22GB of RAM. But over time, even if the servers have no one on them, from the control panel it shows the RAM going down. So after about 32 hours of the server being up, the RAM Free has gone down to 170MB! I don’t understand, because the servers have been empty mostly and haven’t been using much ram, except for the modpack server, but that always uses 4-6GB of RAM. And then when I go to my Server Control Panel Page, it shows i’m only using 50% of my RAM, but when I go to the MineOS Page, it’s showing 170MB (99% of my RAM is gone). Is this a bug? or is this how minecraft servers work?

http://www.linuxatemyram.com/ !

Thanks. So say if it says 170MB, I’m safe to start a server anyway? To really see how much ram I have I should do ‘free -m’

I wouldn’t make that generalization, no.

But the site I linked you to tells you about “top” which will help you–in your specific case–determine whether or not the memory is cached or whether it is free.

If it truly isn’t free, then starting a server will do no good. It could just as well be that your other server leaked memory and it is lost (and you need to restart your host). We can’t tell, merely with the information 170mb, so you’ll have to look it up a bit.

I did ‘free -m’ in console and this is what came out:

# free -m
total       used       free     shared    buffers     cached
Mem:         32074       7053      25021          0         21        519
-/+ buffers/cache:       6512      25562
Swap:         1021          0       1021

Realise this is an Old Thread, but I highly recommend setting up a cache drop via Cron Job, I get this to run every hour or so (I have maps updating regularly that contribute to RAM Caching) and the evidence is clear:-

mike@HomeStream:~$ free -m
total used free shared buffers cached
Mem: 7889 7706 182 72 1045 1301
-/+ buffers/cache: 5360 2529
Swap: 8095 612 7483
mike@HomeStream:~$ sudo sysctl -w vm.drop_caches=3
mike@HomeStream:~$ free -m
total used free shared buffers cached
Mem: 7889 3792 4096 72 3 146
-/+ buffers/cache: 3642 4246
Swap: 8095 612 7483

This is the command:-

sudo sysctl -w vm.drop_caches=3

I definitely recommend against this, in all circumstances.

Unused RAM (ram that is available, unused altogether) is wasted RAM. The purpose of a server is to serve data; when caches are cleared, the system will have to reload its caches from disk, which is orders of magnitude slower than if it were already in memory.

Why Empty RAM is Useless
You may be thinking that using RAM as a cache is great, but you don’t want these program files and other data taking up your RAM. You’d rather have empty RAM available so that programs will launch instantly and the memory will be used for what you think is best, not what your operating system and programs think is best.

However, this isn’t a concern at all. Whether your RAM is full of cached files or completely empty, it’s all available for programs that really need it. Cached data in your RAM is marked as low-priority, and it’s instantly discarded as soon as the memory is needed for something else.

Because this data can be instantly discarded when necessary, there’s no disadvantage to using the RAM for cache. (The one potential disadvantage is users who don’t understand what’s going on becoming confused.)

Empty RAM is useless. It’s not any faster for the computer to write data to empty RAM, nor does empty RAM use less power. In fact, assuming you’re launching a program that may already be present in your RAM’s file cache, programs will load much faster when your RAM is used rather than when it’s empty.

1 Like