raspfly
Posts: 132
Joined: Sun May 27, 2012 1:42 am

Virtual RAM

Wed Jan 22, 2014 6:41 am

Is it possible in any way to use a part of the SD card memory and use it as 'virtual' RAM ?

ghellquist
Posts: 73
Joined: Thu Aug 02, 2012 8:47 am
Location: Stockholm Sweden

Re: Virtual RAM

Wed Jan 22, 2014 6:43 am

Yes. That is what swapping is about. Linux does this if you enable swapping. The problem is that things start running very slow.

// Gunnar

raspfly
Posts: 132
Joined: Sun May 27, 2012 1:42 am

Re: Virtual RAM

Wed Jan 22, 2014 7:13 am

I had an impression with swapping things should run faster !

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Virtual RAM

Wed Jan 22, 2014 7:24 am

raspfly wrote:I had an impression with swapping things should run faster !
No, swapping allows the OS to use more ram than the system physically has. The cpu can't access memory that has been swapped out. Pages of data need to be copied to and from disk (or in this case the file system on the SD card). So no all this takes a lot of time and doesn't speed up your system.

User avatar
rpdom
Posts: 16972
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Virtual RAM

Wed Jan 22, 2014 7:34 am

Swapping can help, as parts of programs that are running, but not being used, get swapped out to the slower swap space until they get called for again. This frees up more RAM for buffering files which makes the system more responsive.

However, if too many programs are using too much RAM, they will each get swapped out and then back in again rapidly, which will slow the system down to a crawl.

You have the choice whether to have a large swap and your system running slow if it is overloaded, or to run with less or no swap and have the Out Of Memory Killer kill programs when there isn't enough RAM left.

raspfly
Posts: 132
Joined: Sun May 27, 2012 1:42 am

Virtual RAM

Wed Jan 22, 2014 7:52 am

These days I started teaching basic computing to some elderly and introduced RPi to them.
I do not know why, though my RPi is the V1.0 B, but found it to be running way slower than I earlier had experienced.
So I thought of using SWAP to 'increase' the RAM. But seems it is not a good solution.
Last edited by raspfly on Wed Jan 22, 2014 3:45 pm, edited 1 time in total.

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Virtual RAM

Wed Jan 22, 2014 1:24 pm

Try swapping back to an earlier image and see if your RPi has actually got slower

Most of us have just seen one speed increase on top of another since the early days :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

klricks
Posts: 7122
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Virtual RAM

Wed Jan 22, 2014 2:19 pm

If you are not using the RPi for allot of video watching then try changing the memory split to 16. The 16 value will give the maximum amount of memory to the CPU and still give enough to the GPU for basic screen handling.

sudo raspi-config

Goto 8 (Advanced Options) then A3
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

raspfly
Posts: 132
Joined: Sun May 27, 2012 1:42 am

Re: Virtual RAM

Thu Jan 23, 2014 3:31 pm

Ok, I will try that.

Return to “General discussion”