Welcome! Wikis are websites that everyone can build together. It's easy!

Location: The Official Oracle Wiki

Discussion: Urgent:-Linux Memory Tuning

Keyword tags: ACBS content management DBA Certitification ibr idc middleware oracle oracle applications Oracle eAM site studio stellent ucm
Watch

Anonymous  (Get credit for your thread)


Harsh.Chawla

Harsh.Chawla
Urgent:-Linux Memory Tuning
Mar 12 2008, 7:17 AM EDT
Dear,
I am having application on RHEL which is having 16GB of physical memory whidch gets filled in 24 hours. This system is havibg both database and tomcat server on it.When whole physical memory fills up . i stop all the processes including oracle and tomcat's. But still the memory usage is not reduced so much . It's cached memory is as shown below

total used free shared buffers cached
Mem: 16415044 11321316 5093728 0 170428 9676688
-/+ buffers/cache: 1474200 14940844
Swap: 16386292 725644 15660648. Please suggest me what could be done to reduce the caching so that it could adjust in 16gb of RAM itself without using swap area.

Issue is very critical.Because for freeing up all the memory i need to reboot the server on daily basis.

Please suggest the optimum solution for this
5  out of 18 found this valuable. Do you?    
dratster_gt

dratster_gt
RE: Urgent:-Linux Memory Tuning
Mar 15 2008, 9:18 AM EDT
Can you describe a little more about the application that you are running? Are using TOP to determine what are the processes that consuming the most memory? If application related, are you doing anything to free memory once a particular screen and/or process is done?

more info, the better to analyze your problem

thanx,
DaVID
0  out of 4 found this valuable. Do you?    
Easyteam

Easyteam
RE: Urgent:-Linux Memory Tuning
Mar 17 2008, 3:28 AM EDT
"Dear,
I am having application on RHEL which is having 16GB of physical memory whidch gets filled in 24 hours. This system is havibg both database and tomcat server on it.When whole physical memory fills up . i stop all the processes including oracle and tomcat's. But still the memory usage is not reduced so much . It's cached memory is as shown below

total used free shared buffers cached
Mem: 16415044 11321316 5093728 0 170428 9676688
-/+ buffers/cache: 1474200 14940844
Swap: 16386292 725644 15660648. Please suggest me what could be done to reduce the caching so that it could adjust in 16gb of RAM itself without using swap area.

Issue is very critical.Because for freeing up all the memory i need to reboot the server on daily basis.

Please suggest the optimum solution for this
"
Hello,

Meaning no offense, I think you should read some linux admin book or google that a bit. This is absolutely normal and there's nothing to do about it (well you could change that indeed with some kernel tuning, but that would be useless).

"cached" memory is a disk cache that the kernel fills as it reads data from the disks, in case they're needed. Needless to say, that memory will be freed when a process reclaims any.

This is why the free command that you use shows a second line "-/+ buffers/cache" where it calculates the used / free memory including that cache, in your case 1474200 / 14940844.

You still have 14 Gigs free RAM.

Regards
2  out of 7 found this valuable. Do you?    
Harsh.Chawla

Harsh.Chawla
RE: Urgent:-Linux Memory Tuning
Mar 17 2008, 11:41 PM EDT

Dear,
if i see output through top then i notice that it shows me 13gb off used .I understand that the actual free memory would be shown to me by free command whose output as shown below.

total used free shared buffers cached
Mem: 16415044 13194736 3220308 0 312844 10095968
-/+ buffers/cache: 2785924 13629120
Swap: 16386292 580960 15805332

Now you can see it is also using some space from swap area. but if i have 13Gb of free RAM than why it is using .
I want that it should get satisfied in Physical memory space. Is it possible. Or are there any parameters that needs to be checked.

One more question is .: In the following scenario You can see that there is 10 GB of free space . This is the scenario that face in the morning. I on the daily basis stops all the processes of both oracle and TOMCAT. But then also there is just little bit change in the output of "free" command.

total used free shared buffers cached
Mem: 16415044 16392396 22648 0 404332 10061660
-/+ buffers/cache: 5926404 10488640
Swap: 16386292 509236 15877056

The thing i want to ask is that if i stop all the processes then it should free up the space the output of free after stopping all the processes is as below

" total
Mem: 16415044
-/+ buffers/cache:
Swap: 16386292" used free shared buffers cached
10587204 5827840 0 170880 9128936
1287388 15127656
240 16386052

Shouldn't it release all the cahced memory space also.

***when i restart the server then only it releases the cached space.

Please suggest whether i need to restart the server or not.


0  out of 4 found this valuable. Do you?    
Harsh.Chawla

Harsh.Chawla
RE: Urgent:-Linux Memory Tuning
Mar 17 2008, 11:49 PM EDT
Dear ,
I have one server with 16Gb of ram and 8processor machine. I have installed oracle database 10g and tomcat apache server on the same machine.

Following problem is there.

if i see output through top then i notice that it shows me 13gb off used .I understand that the actual free memory would be shown to me by free command whose output as shown below.

total used free shared buffers cached
Mem: 16415044 13194736 3220308 0 312844 10095968
-/+ buffers/cache: 2785924 13629120
Swap: 16386292 580960 15805332

Now you can see it is also using some space from swap area. but if i have 13Gb of free RAM than why it is using .
I want that it should get satisfied in Physical memory space. Is it possible. Or are there any parameters that needs to be checked.

One more question is .: In the following scenario You can see that there is 10 GB of free space . This is the scenario that face in the morning. I on the daily basis stops all the processes of both oracle and TOMCAT. But then also there is just little bit change in the output of "free" command.

total used free shared buffers cached
Mem: 16415044 16392396 22648 0 404332 10061660
-/+ buffers/cache: 5926404 10488640
Swap: 16386292 509236 15877056

The thing i want to ask is that if i stop all the processes then it should free up the space the output of free after stopping all the processes is as below

" total

Shouldn't it release all the cahced memory space also.

***when i restart the server then only it releases the cached space.



0  out of 5 found this valuable. Do you?    
lfreitas34

lfreitas34
RE: Urgent:-Linux Memory Tuning
Mar 28 2008, 1:21 AM EDT
"Hello,

Meaning no offense, I think you should read some linux admin book or google that a bit. This is absolutely normal and there's nothing to do about it (well you could change that indeed with some kernel tuning, but that would be useless).

"cached" memory is a disk cache that the kernel fills as it reads data from the disks, in case they're needed. Needless to say, that memory will be freed when a process reclaims any.

This is why the free command that you use shows a second line "-/+ buffers/cache" where it calculates the used / free memory including that cache, in your case 1474200 / 14940844.

You still have 14 Gigs free RAM.

Regards"

This allocated memory can cause out of memory errors when there are large allocation requests, it also caused the oom killer to be started on some versions of the kernel. It is not desirable on a database only server, as there is little use for the operating system buffer cache. It would be better utilized as database buffer cache.

On some operating systems there are tuning parameters to keep the O/S from using all available memory for the buffer cache. Unfortunatelly this seems to be missing on the 2.6 kernel.

1  out of 3 found this valuable. Do you?    
oracleheavywt
oracleheavywt
RE: Urgent:-Linux Memory Tuning
Apr 9 2008, 10:11 PM EDT
At all costs, avoid swapping.

Be sure to lower the swappiness level.

Also, use Huge pages.

Perhaps you have already done these two steps?
2  out of 3 found this valuable. Do you?    
Harsh.Chawla

Harsh.Chawla
RE: Urgent:-Linux Memory Tuning
Apr 10 2008, 2:27 AM EDT
Dear ,

Can you please tell me how can do all these stuff.


0  out of 2 found this valuable. Do you?    
hbokho
hbokho
RE: Urgent:-Linux Memory Tuning
Apr 12 2008, 6:33 AM EDT
Please provide some more information about what version of RHEL you're runing and what dspecific Oracle database-version. (9i, 10g, 11g?)

Also take a look at your system's kernel paramters in sysctl.conf.
Some useful information if you're on 10g:

http://www.oracle.com/technology/pub/articles/smiley_10gdb_install.html#kernel
http://www.puschitz.com/InstallingOracle10g.shtml
1  out of 3 found this valuable. Do you?    
Harsh.Chawla

Harsh.Chawla
RE: Urgent:-Linux Memory Tuning
Apr 14 2008, 3:38 AM EDT

Dear my kernel version is
2.6.9-55.0.2.0.1.ELsmp

i am using oracle01g r2

sysctl.conf output
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 1583984
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144



0  out of 2 found this valuable. Do you?    
hbokho
hbokho
RE: Urgent:-Linux Memory Tuning
Apr 14 2008, 5:36 AM EDT
"Huge pages" is (are?) not needed on your kernel-version.
Instead, try raising your kernel.shmmax to a higher value, e.g.: kernel.shmmax=8403812352
Edit the file /etc/sysctl.conf with this new value, reload this file with "sysctl -p /etc/sysctl.conf" and stop/start your database.

Check BEFORE and AFTER the database-restart some memory-values with the command "ipcs -m".
0  out of 1 found this valuable. Do you?    
yusukeyurameshi

yusukeyurameshi
RE: Urgent:-Linux Memory Tuning
Apr 18 2008, 5:01 PM EDT
Dear,

I think you have to reconsider what exactly your problem is.
Because, even if you discover how to flush the memory, I think unacceptable you have to restart your database and tomcat every day.
Instead of that, you have to discover why your 16 Gb fill up in 24 hours.
I had a similar issue with Oracle Database 10gR1 and Oracle IAS. The problem was the connection pool.
They open a lot of connection and never close, even if they don't use it anymore.
Did you see the number of sessions in database when the memory is full?
The number of sessions does match with the load in tomcat?
In my case we changed the THIN connection to OCI and use Oracle data source class.
Now I have my Oracle database running 24X7 very stable.

Note: If you have Linux 32 Bits, don't even try increase the value of kernel.shmmax.

Regards,
Fábio Ferreira
0  out of 1 found this valuable. Do you?    

Related Content

(what's this?Related ContentThanks to keyword tags, links to related pages and threads are added to the bottom of your pages. Up to 15 links are shown, determined by matching tags and by how recently the content was updated; keeping the most current at the top. Share your feedback on Wetpaint Central.)