Already a member?
Sign in
Location:
The Official Oracle Wiki
Discussion: Linux Memory Fill Up problem
Watch
|
Harsh.Chawla |
Linux Memory Fill Up problem
Mar 10 2008, 6:29 AM EDT Dear Friends, I am facing memory shoot up problem on My machine. My system is having RAM 16gb on this machine i am having database server and TOMCAT Server installed and java based Three tier application. My all memory shoot up in 24 hours and it starts using swap area even. Please suggest me what can i do.. Thanks Batala 6 out of 11 found this valuable. Do you? |
|
jtomas jtomas |
RE: Linux Memory Fill Up problem
May 8 2008, 4:03 AM EDT I have a similar problem. The cause (in our case) was the Linux memory management. When we use some processes that uses a lot of Linux filesystem (not direct I/O or ASM) the operating system uses the "cached" RAM memory. For example if I execute a backup of $ORACLE_BASE folder with tar command, this will create a tar.gz file of 16GB that will use 16GB of RAM(Cached). This causes that Free Memory goes to 0. When you delete the tar file the Cached memory is moved again to Free Memory. But during tar creation Free Memory is close to zero. Using ftp to transfer to server big installation files causes the same behaviour. This Cached RAM is also considered as free, and will be used by OS when it needs, but Oracle processes seems to prefers use Swap. Solutions: 1.-The best solution for us would be to limit the size of Cached Area. But this option is only available on Linux RedHat 3 family (Not on RH4 or RH5). 2.- Execute: #echo 3 > /proc/sys/vm/drop_caches This will move cached memory to free. You can execute each 15 minutes as basis. But this option is only available on Linux RedHat 5 family (Not on RH3 or RH4). 3.- Play with swappiness parameter. Dangerous!!!. By default has the value of 60. 4.- Not use any process that uses big files without Direct I/O. 0 out of 3 found this valuable. Do you? |
|
hbergh |
RE: Linux Memory Fill Up problem
May 9 2008, 1:49 PM EDT Batala, If your system starts using swap area, then the problem is not just due to memory being used as cache, as jtomas suggests. It means that the memory manager can no longer free enough cache pages to make room for application memory pages, and it starts moving other ("cold") application memory pages to swap to make room for new ones. You will need to monitor memory usage of your applications, and see which process is responsible for exceeding the available memory. It could be the database processes, if they're executing memory intensive requests, or it could be the java processes. I would suggest you start by monitoring the RSS or RES (resident set size) of processes, which shows the number of physical memory pages in use by that particular process. The database processes will share some (or most) of the pages that are in the SGA (shared memory segment), so you may want to subtract the size of the SGA from the RSS of oracle processes to see roughly how many non-shared pages they have. The top and ps commands can give you this information. I find it useful to sort the top output by RES, but if your database has a large SGA, you will find mostly oracle processes on top, and the processes with the most private RSS may not be visible if they're not oracle processes. 2 out of 3 found this valuable. Do you? |
|
Harsh.Chawla |
RE: Linux Memory Fill Up problem
Jun 6 2008, 5:38 AM EDT "Dear Friends,Hi all, I have found the solution of this problem It was very long research for me. But when i got the solution i found it was just a small one. Friends , There is process on my server to put the backups on the tape which takes 4 hrs to complete. Therefore after closing all the processes it showed like memory is stuck somewhere. There was one way in LINUX by which manual flush could be done. After analysis it was found that at the time of backups the memory utilization went high, it was the one which used to be cached in memory. Therefore after stopping all the processes the memory wasn’t being released. There is one way in LINUX by which we can flush cached memory manually. By using the following script we can do this Step1. #dd if=/dev/zero of=junk bs=10MB count=1600 #generate a 2000MB file Count =1600 is given it is as per the physical memory (16GB is there in our case). It created a file of name junk of 16GB. While this activity large CPU and memory utilization was seen. Step2. # rm junk. Then this file was removed. While removing this file there was huge reduction in memory utilization. It flushed out all the unused memory. It made invalid the data in dirty buffers and made memory free for other use. Before Implementation:- Mem: 16415044k total, 16384060k used, 30984k free, 366968k buffers Swap: 16386292k total, 824748k used, 15561544k free, 10995320k cached After Implementation:- Mem: 16415044k total, 10597668k used, 5817376k free, 32648k buffers Swap: 16386292k total, 95688k used, 16290604k free, 781064k cached Here a great change could be seen. 0 out of 1 found this valuable. Do you? |
|
Harsh.Chawla |
RE: Linux Memory Fill Up problem
Jun 6 2008, 10:43 PM EDT "I have a similar problem.Hi all, I have found the solution of this problem It was very long research for me. But when i got the solution i found it was just a small one. Friends , There is process on my server to put the backups on the tape which takes 4 hrs to complete. Therefore after closing all the processes it showed like memory is stuck somewhere. There was one way in LINUX by which manual flush could be done. After analysis it was found that at the time of backups the memory utilization went high, it was the one which used to be cached in memory. Therefore after stopping all the processes the memory wasn’t being released. There is one way in LINUX by which we can flush cached memory manually. By using the following script we can do this Step1. #dd if=/dev/zero of=junk bs=10MB count=1600 #generate a 2000MB file Count =1600 is given it is as per the physical memory (16GB is there in our case). It created a file of name junk of 16GB. While this activity large CPU and memory utilization was seen. Step2. # rm junk. Then this file was removed. While removing this file there was huge reduction in memory utilization. It flushed out all the unused memory. It made invalid the data in dirty buffers and made memory free for other use. Before Implementation:- Mem: 16415044k total, 16384060k used, 30984k free, 366968k buffers Swap: 16386292k total, 824748k used, 15561544k free, 10995320k cached After Implementation:- Mem: 16415044k total, 10597668k used, 5817376k free, 32648k buffers Swap: 16386292k total, 95688k used, 16290604k free, 781064k cached Here a great change could be seen. 0 out of 1 found this valuable. Do you? |
|
Harsh.Chawla |
RE: Linux Memory Fill Up problem
Jun 6 2008, 10:43 PM EDT "Batala,Hi all, I have found the solution of this problem It was very long research for me. But when i got the solution i found it was just a small one. Friends , There is process on my server to put the backups on the tape which takes 4 hrs to complete. Therefore after closing all the processes it showed like memory is stuck somewhere. There was one way in LINUX by which manual flush could be done. After analysis it was found that at the time of backups the memory utilization went high, it was the one which used to be cached in memory. Therefore after stopping all the processes the memory wasn’t being released. There is one way in LINUX by which we can flush cached memory manually. By using the following script we can do this Step1. #dd if=/dev/zero of=junk bs=10MB count=1600 #generate a 2000MB file Count =1600 is given it is as per the physical memory (16GB is there in our case). It created a file of name junk of 16GB. While this activity large CPU and memory utilization was seen. Step2. # rm junk. Then this file was removed. While removing this file there was huge reduction in memory utilization. It flushed out all the unused memory. It made invalid the data in dirty buffers and made memory free for other use. Before Implementation:- Mem: 16415044k total, 16384060k used, 30984k free, 366968k buffers Swap: 16386292k total, 824748k used, 15561544k free, 10995320k cached After Implementation:- Mem: 16415044k total, 10597668k used, 5817376k free, 32648k buffers Swap: 16386292k total, 95688k used, 16290604k free, 781064k cached Here a great change could be seen. 0 out of 1 found this valuable. Do you? |
