If your system is low on RAM and using the swap partition then yes you’d notice a BIG difference
If it’s not using the swap partition then you’re unlikely to notice any difference at all
If I had to guess I’d say with 4GB and if you’re running a single XP VM (using the virtualbox default memory settings) you’re unlikely to be using the swap partition … but this obviously depends on what else you have the host OS doing.
Do what you normally do, and when you consider the system “under load” open a terminal and run:
free -m
if “swap used” says anything other than 0 you’ll benefit from more RAM (or possibly just changing the “swappiness” setting … the point at which the system starts to use the HDD as memory)
Swap used is resolutely sticking at zero,with one (XP) VM running, even while streaming live TV on the host.
But as soon as I run up a Linux Mint VM as well, things grind to a halt and the swap file is used. I’m unlikely to use multiple VMs simultaneously, however, so I think I’ll keep that £56 in my pocket, despite the fact that received wisdom says that more RAM is always good.
I’d check how the system is with just a Mint or Ubuntu VM running … remember XP was lighter than the current versions of Ubuntu/Mint, and MUCH lighter than Win Vista/7/8 … I think virtualbox automagically allows more RAM for a Win7/8 VM now.
It really depends on what you’re planning to do though
If I were you I’d also consider changing your “swappiness” setting from the default 60 to something like 10 … swap will only get used when it’s getting critical to do so (down to 10% RAM left).
Run:
cat /proc/sys/vm/swappiness
and I’d expect it to be set to the default
60
meaning your system will start to use swap when 60% of RAM is remaining (this made sense when systems had small amounts of RAM but not not so much with 4GB)
Now let’s change that to a swappiness of 10 (swap only starts to be used when there’s 10% RAM remaining) … run:
sudo gedit /etc/sysctl.conf
and add these 2 NEW lines at the bottom
# Set swappiness to 10 (added by mikep)
vm.swappiness = 10
Things still going well, but I’m baffled by the results of free -m.
Total memory shows as 3952, used as 3838, free as 113, shared 48, buffers 241 and cached 1628.
I suspect this means almost all my RAM is being used (but swap isn’t), and that we’re talking gibibytes, not gigabytes. Can you enlighten me please?
Also - if almost all my physical RAM is indeed in use, would there be any benefit from installing more? I suspect not (based on your first reply), but I seem to be sailing close to the wind…
Just busy with the build up to the Peppermint 6 release
I suspect this means almost all my RAM is being used (but swap isn't), and that we're talking gibibytes, not gigabytes. Can you enlighten me please?
Neither … free is talking bytes.
but I seem to be sailing close to the wind
Well if you load anything else it’ll start to swap, and things will slow considerably … so it’s up to you if you think more memory is worthwhile, or if you just wanna keep an eye on what you have loaded at any one time.
But I told you I’d changed the swappiness on May 14th…
You usually respond to feedback (not that it’s necessary) so I suppose I kind of expected a “You’re welcome” or something of that nature. Just got slightly worried at what I thought was a prolonged absence, based on your normal M.O.
Glad to know you’re not slumped over a keyboard in sunny Kernow!
I need more RAM but can’t afford it right now; I think we did the swap thing for me ages ago- could I check it with you please Mark? (Peppermint 3 on the laptop).
Thanks Mark- if you could tell me how much RAM I need to get I will write it down and keep it safe! I have to reboot a lot when accessing a lot of videos in succession or having a few web pages open with tons of photos on them ( the laptop freezes and that stop script box comes up).
Handle 0x000B, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x000A
Error Information Handle: No Error
Total Width: 64 bits
Data Width: 64 bits
Size: 256 MB
Form Factor: SODIMM
Set: None
Locator: DIMM #1
Bank Locator: Not Specified
Type: DDR2
Type Detail: Synchronous
Speed: 667 MHz
Manufacturer: 7F7F7F7F7F510000
Serial Number: 0102F523
Asset Tag: Not Specified
Part Number: 64T32000HDL3SB
Handle 0x000C, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x000A
Error Information Handle: No Error
Total Width: 64 bits
Data Width: 64 bits
Size: 512 MB
Form Factor: SODIMM
Set: None
Locator: DIMM #2
Bank Locator: Not Specified
Type: DDR2
Type Detail: Synchronous
Speed: 667 MHz
Manufacturer: 7F7F7F0B00000000
Serial Number: 8B152F02
Asset Tag: Not Specified
Part Number: M2N51264TUH8A2F-3C
Zswap is a lightweight, write-behind compressed cache for swap pages. It takes pages that are in the process of being swapped out and attempts to compress them into a dynamically allocated RAM-based memory pool. If this process is successful, the writeback to the swap device is deferred and, in many cases, avoided completely. This results in a significant I/O reduction and performance gains for systems that are swapping
Check if it is enabled in your kernel:
cat /boot/config-`uname -r` | grep ZSWAP
If that returns CONFIG_ZSWAP=y then good to go to enable it.