Yeah, I don't understand what the problem is here.
Linux by default uses free system RAM to cache disks and all sorts of other things. This cache helps speed up future disk reads, as they are read from the fast ram, instead of the relatively slow disk. We WANT Linux to do this. It is a good thing, it improves performance, lowers power consumption and reduces wear on drives.
This DOES NOT mean that the file has not yet been committed to disk. It usually has right away (unless drive is mounted async, and even then it's usually only a delay of a second or two). If you want to make sure changes have been committed to the drive (if you are paranoid) you can use the command "sync", which should write all non-written blocks to the drive instantly and update the superblock.
If you want to tell the difference between RAM used by programs and RAM used by caches, you can go to the console and look at the "free" command.
Code:
root@proxmox:~# free -h
total used free shared buffers cached
Mem: 188G 79G 109G 49M 92M 11G
-/+ buffers/cache: 67G 121G
Swap: 58G 13M 58G
In this example from my server there are 188GB in total (192 actually, not sure the reported amount is lower)
79GB of these are used in total (by either programs, or caches)
109GB are free and completely unused.
11GB of the 79GB above are being used as cache.
If you look under the +/- caches sections we see:
67GB are actually used by programs, so if I suddenly load up my server with all my VM's and it starts running out of RAM, it will drop the cache and use it for programs. The total amount of RAM available, once caches are dropped is 121GB.
I hope this helps.