Running our Java application and MySQL server on Fedora 16 with 64bit kernel 3.3.7-1, we never see a decrease of used memory after the application and the database server is stopped. This does not relate to memory used for file caching and disk buffers.
The following is the output of 'free -m' after the application and the database server is stopped (with a necessary wait so that neither is shown using 'ps'). The server's description comes from 'uname -a'.

Notice the difference between the amount of overall used and free memory, i. e. including buffers/cache (indicated bold) between the two servers. We would expect that after stopping the application and database server, the amount of used would shift to free also on the server with kernel 3.3.7-1.
So I would like to know what's going on with the allocated memory or the free utility. Appreciate anyone shedding a little light on this matter.

Kustom42

07-23-2012 12:41 PM

Memory is handled quite differently in Linux than in Windows. In Windows you should see memory immediately returned to the pool when an application is done with it. In Linux it will go into a "Dirty" or "Inactive" state until there is another process that needs it, at which point it is cleaned and returned to the free pool for other applications.

Your /proc/meminfo file will give you detailed info about where your memory is at, use this as your reference point and not free -m or those other utilities if you really want to see whats going on. Those utilities are great for a quick snapshot of the overall picture but will not give you the details that you are looking for.

There are some sites out there that explain this but I can't find one that I like as the explanations on sites like linuxatemyram.com are a bit high level and don't really explain it. I did find a good page that explains the meminfo file: http://unixfoo.blogspot.com/2008/02/...ocmeminfo.html

w359

07-31-2012 11:44 AM

Thanks a lot for your reply. I have yet to look into /proc/meminfo on the servers which I plan to do after vacation.

However, I never compared the memory handling between Windows and Linux. My problem is with the difference I see when using free with different kernel versions (or Fedora versions) under the same circumstances. The problem is also that the amount of memory shown as Used with kernel 3.3 didn't decrease even after a few days of uptime.
Can anyone point me to the right direction on the actual issue?

Thanks for any information in advance.

Kustom42

08-01-2012 12:39 PM

Ok well just wanted to make sure that it wasn't the case of not knowing the Linux memory features. We should take a look at the meminfo file before digging anywhere else, thats the first place to check when you want to see what your system is doing with your memory.