LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   swap memory (https://www.linuxquestions.org/questions/linux-software-2/swap-memory-633877/)

rehan999 04-08-2008 05:07 AM

swap memory
 
Good Morning All

I have a machine which is installed with RHEl 4.3 and is having 16 GB of physical RAM and 2 Gb swap space.
When i run any application the memory is been taken from the swap memory not the physical memory which is having so much free space.


Will u please advise me how to slove the problem .I need the applcations to be used physical memory not the swap memory.

If physical memory is full then it should go for swap memory...

Please help me out...

syg00 04-08-2008 06:15 AM

Show us the output for these commands
Code:

uname -a
free -m
grep -i highmem <your kernel config here>
grep -i 64bit <your kernel config here>

I don't know where RHEL stores the config - hopefully somewhere obvious - like /boot or /proc/confi.gz

rehan999 04-08-2008 06:35 AM

1) Linux hostname 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:56:28 EST 2006 x86_64 x86_64 x86_64 GNU/Linux

2)
hostname ~ ->% free -m
total used free shared buffers cached
Mem: 15962 15918 44 0 5 10431
-/+ buffers/cache: 5481 10481
Swap: 1992 1988 3

Thanks and Regards
Rehan

johnsfine 04-08-2008 08:35 AM

If I'm reading that right, it indicates you have about 10Gb of files cached in physical ram, which has resulted in kicking 2Gb of memory of idle processes into the swap space.

You can configure the "swapiness" of a Linux system to make it favor idle processes over active file cache. But first you should be sure that is really what you want to do.

Without such changes, Linux is pretty good at deciding how to use memory. For typical file access patterns, the disk I/O saved by that file caching is larger than the disk I/O expended on that swapping.

The overall statistics might have led you to misunderstand the memory use:

Quote:

Originally Posted by rehan999 (Post 3114396)
When i run any application the memory is been taken from the swap memory not the physical memory

That isn't accurate. When you run any application the memory used is physical (since you have so much). The issue is that it must take that physical memory away from some previous use: either take it away from some idle process (using swap space to do so) or take it away from file caching (not using swap space to do so).

rehan999 04-09-2008 06:52 AM

No the machnie was using the swap space instead of physical memory.

But i rebooted the machnie tehn run the command free -m
it gave the out put which i posted.
hostname ~ ->% free -m
total used free shared buffers cached
Mem: 15962 15918 44 0 5 10431
-/+ buffers/cache: 5481 10481
Swap: 1992 1988 3

but previously before rebooting it was using the swap space instead of physical memory.

If i run any process now it is taking physical memory .
But still it is not taking the full physical memory some of the memory is taken from the swap also.

I want my machnie to first complete the physical memory then go to swap memory..

Please help me.

johnsfine 04-09-2008 07:45 AM

Quote:

Originally Posted by rehan999 (Post 3115657)
No the machnie was using the swap space instead of physical memory.

How do you know that?

Quote:

But i rebooted the machnie tehn run the command free -m
it gave the out put which i posted.
So that output from free was shortly after rebooting???

What applications start up automatically when you boot that system?

That output from free says 10431 Mb of ram is in use for caching. That's more than the total a typical Linux system would have read from disk shortly after booting.

If that really was shortly after booting, then you should figure out what is causing all that caching. That will tell you what is making it use swap space (for non caching memory use).


All times are GMT -5. The time now is 12:00 PM.