LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (http://www.linuxquestions.org/questions/fedora-35/)
-   -   releasing memory with Fedora 16 (http://www.linuxquestions.org/questions/fedora-35/releasing-memory-with-fedora-16-a-4175418196/)

w359 07-23-2012 05:31 AM

releasing memory with Fedora 16
 
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'.

1) our problem server: Linux <hostname> 3.3.7-1.fc16.x86_64 #1 SMP. Free:
Code:

            total      used      free    shared    buffers    cached
Mem:          7987      5446      2540          0          8        141
-/+ buffers/cache:      5297      2690
Swap:            0          0          0

2) a comparable server running on different kernel version: Linux <hostname> 2.6.35.14-96.fc14.x86_64 #1 SMP. Free:
Code:

            total      used      free    shared    buffers    cached
Mem:          3964      1910      2054          0        347      1268
-/+ buffers/cache:        293      3670
Swap:          895          2        893

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.


All times are GMT -5. The time now is 03:34 PM.