Author Topic: Solved: Swap is using half of my ram  (Read 933 times)

Offline rayk242

  • Jr. Member
  • **
  • Posts: 10
Solved: Swap is using half of my ram
« on: June 05, 2012, 02:22:29 AM »
I have 8gb of memory installed and a blazing fast 1 Tb hdd. Swap is using 4gb of my memory so when I want to allocate more memory to an OS in VitualBox I get a warning telling me that I am allocating over half of my system memory (2gb)
and that my system may not function properly. I would like more ram available to the system 6-7gb
I tried to edit the /etc/sysctl.conf file as root but was denied access.

"cat /proc/sys/vm/swappiness" returns a value of 0, how do I change that as I cannot edit sysctl.conf.

Thanks, Ray K
« Last Edit: June 11, 2012, 09:00:20 AM by rayk242 »

Offline TerryN

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 732
Re: Swap is using half of my ram
« Reply #1 on: June 05, 2012, 03:08:41 AM »
What kernel are you using?  To find out open a terminal window and type:

Code: [Select]
uname -r
In order to use the full 8GB of RAM on a 32-bit OS you need to be using the .pae kernel.

Terry
Dell E521 - AMD 64 X2 5000+, 4GB RAM, ATI X1300 graphics
PCLinuxOS 2013 (KDE)
|Twitter|

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Swap is using half of my ram
« Reply #2 on: June 05, 2012, 03:09:41 AM »
You're using the default kernel. Install the .pae or .pae.bfs kernel to access all of your RAM.    
note: first boot into a new kernel takes longer than a normal boot up. Modules/drivers must compile against the new kernel.    

edit: Terry was faster than me this morning. ;D     

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10696
  • MLUs Forever!
Re: Swap is using half of my ram
« Reply #3 on: June 05, 2012, 04:21:54 AM »
Quote
Swap is using 4gb of my memory

Are you sure?
Did you set up Swap to use RAM?

What is the output of the following command (the first couple of lines are all that is needed).


top | grep -i swap
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline rayk242

  • Jr. Member
  • **
  • Posts: 10
Re: Swap is using half of my ram
« Reply #4 on: June 10, 2012, 11:51:44 PM »
This is what I get:
Swap:  4088504k total,        0k used,  4088504k free,  1016216k cached
Swap:  4088504k total,        0k used,  4088504k free,  1016444k cached
Swap:  4088504k total,        0k used,  4088504k free,  1016444k cached
Swap:  4088504k total,        0k used,  4088504k free,  1016444k cached
Swap:  4088504k total,        0k used,  4088504k free,  1016444k cached
Swap:  4088504k total,        0k used,  4088504k free,  1016444k cached
Any help would be appreciated, thanks

Offline rayk242

  • Jr. Member
  • **
  • Posts: 10
Re: Swap is using half of my ram
« Reply #5 on: June 10, 2012, 11:56:38 PM »
Terry,
"uname -r" posts this:
2.6.38.8-pclos1.bfs
not sure how to install new kernel.
thanks.

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6254
Re: Swap is using half of my ram
« Reply #6 on: June 11, 2012, 12:27:01 AM »

what processor does your system use?

There are different kernels that are tuned to different processors.

Open the terminal and run the following command to know the cpu you are using, Post the output here

cat /proc/cpuinfo


you install a new kernel through synapic, just like any other program.After you are done installing it, restart the computer and the new kernel will be on the boot up list. It might take longer to boot to the new kernel the first time around.

just open synaptic, search for kernel and use the one best suited for you.You should look only those with ".bfs" extension.

You should probably go with "2.6.38.8-pclos3.pae.bfs" kernel
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline rayk242

  • Jr. Member
  • **
  • Posts: 10
Re: Swap is using half of my ram
« Reply #7 on: June 11, 2012, 12:28:29 AM »
Ok, a few new problems after using Synaptic Package Manager to update my system.
1. Super user mode Konqueror no longer works in the user GUI, it no longer asks for the root password.
2. Cannot launch SPM from user GUI, it no longer asks for root password.
3. Cannot edit desktop icons shortcuts to SPM as root in the user GUI.
4. Root menu commands in Dolphin no longer work.
Anyone know why? All of these worked just fine prior to my update.
I updated in order to install the new kernel to resolve the ram issue.
I have not yet installed the new kernel as I was working in the user desktop, did the updates, re-booted and tried to start SPM. This when I found the problems listed above.
Thanks Rayk242

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6254
Re: Swap is using half of my ram
« Reply #8 on: June 11, 2012, 12:32:49 AM »
This is what I get:
Swap:  4088504k total,        0k used,  4088504k free,  1016216k cached
Swap:  4088504k total,        0k used,  4088504k free,  1016444k cached
Swap:  4088504k total,        0k used,  4088504k free,  1016444k cached
Swap:  4088504k total,        0k used,  4088504k free,  1016444k cached
Swap:  4088504k total,        0k used,  4088504k free,  1016444k cached
Swap:  4088504k total,        0k used,  4088504k free,  1016444k cached
Any help would be appreciated, thanks

by default,swap is located on a hard drive,in a separate dedicated partition. It is not located in RAM and hence does not use up RAM space.

Those entries above says swap is configured to use 4GB of space and none of it is currently in use, ie, there are no memory pressures.
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline rayk242

  • Jr. Member
  • **
  • Posts: 10
Re: Swap is using half of my ram
« Reply #9 on: June 11, 2012, 12:34:23 AM »
I built this system myself and used a dul core AMD Athlon II X2 245 processor.
Here is the pertinent output from "cat /proc/cpuinfo"

processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 16
model           : 6
model name      : AMD Athlon(tm) II X2 245 Processor
stepping        : 2
cpu MHz         : 2900.000
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
 thanks, RayK

Offline rayk242

  • Jr. Member
  • **
  • Posts: 10
Re: Swap is using half of my ram
« Reply #10 on: June 11, 2012, 12:38:51 AM »
I understand however swap has reserved 4GB of ram and will not allow access.
System monitor shows 3.2 GB for application memory and 3.9 GB for swap.
The system will not allow me to use the ram set aside for swap.
Ray K

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6254
Re: Swap is using half of my ram
« Reply #11 on: June 11, 2012, 12:48:50 AM »
Ok, a few new problems after using Synaptic Package Manager to update my system.
1. Super user mode Konqueror no longer works in the user GUI, it no longer asks for the root password.
2. Cannot launch SPM from user GUI, it no longer asks for root password.
3. Cannot edit desktop icons shortcuts to SPM as root in the user GUI.
4. Root menu commands in Dolphin no longer work.
Anyone know why? All of these worked just fine prior to my update.
I updated in order to install the new kernel to resolve the ram issue.
I have not yet installed the new kernel as I was working in the user desktop, did the updates, re-booted and tried to start SPM. This when I found the problems listed above.
Thanks Rayk242

strange problem.
When was the last time you updated before today? You should open a different thread to discuss this problem with an informative title.Those who may know what the problem is may skip this thread because it talks about something else.

While on the terminal, type "su" and then press "enter" and then enter root's password when asked for a password.

The terminal should be with red text now. type "synaptic" and then press enter to start synaptic and install the kernel i mention above. All kernels tuned to AMD processors seem to have a 4GB upper memory limit.
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6254
Re: Swap is using half of my ram
« Reply #12 on: June 11, 2012, 12:55:53 AM »
I understand however swap has reserved 4GB of ram and will not allow access.
System monitor shows 3.2 GB for application memory and 3.9 GB for swap.
The system will not allow me to use the ram set aside for swap.
Ray K

you do not directly use swap space, you only directly use application memory, application memory will start to use swap when it is starting to run out of memory.

The reason why you only have 3.2GB of application memory is not because swap is taking the rest of it, it is because you are currently using a kernel that can use only 4GB of memory which in practice means around 3.2GB and this is what you are seeing.

You could have setup swap to use 512MB of memory,you could set up your system not to use swap at all and you still wont be able to go past 3.2GB. The problem is not with swap but with the kernel you are using.
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline rayk242

  • Jr. Member
  • **
  • Posts: 10
Re: Swap is using half of my ram
« Reply #13 on: June 11, 2012, 12:58:38 AM »
All is right with the world.
I installed the new kernel through the root desktop and rebooted.
All problems in the user desktop are gone and system monitor shows all system ram now available.
I update about every 2 weeks so I have no idea what was going on but no worries.
Thanks for all of your help.
Ray K

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6254
Re: Swap is using half of my ram
« Reply #14 on: June 11, 2012, 01:20:44 AM »

you are welcome.

Can you change the title of your thread and add "solved" to it?

Its one of the rules around here.

You can do that( i think ) by going to the first post, click edit and then change the title
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..