Physical & Virtual Memory - or Why Should 2+2=5 ?

User avatar
stuckling1
2StarLounger
Posts: 142
Joined: 31 Dec 2010, 12:26

Physical & Virtual Memory - or Why Should 2+2=5 ?

Post by stuckling1 »

Stuck and I recently upgraded the RAM in my Acer Aspire 5630 laptop.
Previously it had 2GB; we upgraded this to 4GB - the max the mobo and Win Vista 32bit can support.
The RAM is as two 2GB sticks.
We got the RAM from Crucial and installed it no bother.

However I'm intrigued as to why the system reports 4GB RAM (correct) but only 3GB of "Physical Memory" ?
Also, it reports a further 2GB of "Virtual Memory". Now I understand that Virtual memory is basicly the HD pagefile that pretends to be RAM.

But how come it's not using the whole 4GB's worth of physical memory?
And how come, if Vista 32bit can only address 4gigs of memory, how come the virtual + physical = 5GB ?
And to follow up, if the OS thinks I have 5GB and can deal with that, what's to stop me making the pagefile HUUUUGE (plenty of spare space on the HDD) and getting basicly unlimited RAM?

If any of you wonderful loungers can explain to me how I can have put 2GB + 2GB in and get something that looks like 5, I'd be much obliged!

User avatar
viking33
PlatinumLounger
Posts: 5685
Joined: 24 Jan 2010, 19:16
Location: Cape Cod, Massachusetts,USA

Re: Physical & Virtual Memory - or Why Should 2+2=5 ?

Post by viking33 »

Part of the "problem" is that up until Windows 7 came about, the OS would only report up to 3gigs even though 4 or more was installed. Win 7 now sees the correct amount of RAM installed.
BOB
:massachusetts: :usa:
______________________________________

If I agreed with you we'd both be wrong.

Rui
StarLounger
Posts: 57
Joined: 02 Sep 2011, 10:44

Re: Physical & Virtual Memory - or Why Should 2+2=5 ?

Post by Rui »

The OS knows what physical memory you have and Windows 32 bits can only use 4 GB of RAM. Part of this address space is used by hardware, so the OS does not count with what is used by the hardware, when it reports the amount of memory that it can use. Depending on the hardware, this can vary from 2.x GB to 3.x GB. With a 64 bit OS, this 4GB limit is not present, so the OS will be able to use all of your physical RAM.

You can and will always have more virtual memory than physical memory. The problem is that, at any given moment, apps that need to access memory, can actually access only memory contents that reside in your physical RAM, as apps have no knowledge of physicial or virtual memory. It's the OS that manages the contents of the physical RAM, swapping these contents to and from the disk, as programs use the memory. The fact that you have virtual memory means that an OS will support memory requests from apps, these requests not being limited by the physical RAM available, but by the amount of virtual memory available. Of course, when an app wants to use memory data that at that moment is on the disk (having been swapped there earlier), the OS will have to free space in the physical RAM, by swapping out contents that were there, and then swap in the data that is being needed.

All this swapping in and out has a rather big performance cost, as it takes time to swap data from memory to disk and back, especially because disk access is much, much slower than memory access.

HTH a bit.
Last edited by Rui on 12 Sep 2011, 10:25, edited 2 times in total.

User avatar
DaveA
GoldLounger
Posts: 2599
Joined: 24 Jan 2010, 15:26
Location: Olympia, WA

Re: Physical & Virtual Memory - or Why Should 2+2=5 ?

Post by DaveA »

Also the ON Board graphic card is using some of this 4GB of RAM, which also may be part of the missing Gig.
I am so far behind, I think I am First :evilgrin:
Genealogy....confusing the dead and annoying the living

User avatar
stuckling1
2StarLounger
Posts: 142
Joined: 31 Dec 2010, 12:26

Re: Physical & Virtual Memory - or Why Should 2+2=5 ?

Post by stuckling1 »

Yes. Thankyou Rui, I think I understand now how I can have more memory than RAM due to the hotswapping between virtual & physical memories.

Dave and Viking, both those may also be plausible explainations. Thanks to both :)

At the end of the day though, my PC works and it goes quicker than it did before, so I'm a satisfied customer!
The question was mainly out of curiosity - and the Lounge came up tops!

:grin:

User avatar
tedshemyers
2StarLounger
Posts: 142
Joined: 20 Jan 2011, 19:54
Location: Rochester, NY

Re: Physical & Virtual Memory - or Why Should 2+2=5 ?

Post by tedshemyers »

The limit for 32 Bit Windows is approx. 3.5 GB depending on the system (you state your system is only capable of 4 GB) Theoretically Windows 64 Bit can access much more. This site shows memory limits for various versions of Windows.
Have a Great Day!
Ted


Sony Vaio Laptop, 2.53 MHz Duo Core Intel CPU, 4 GB RAM, 320 GB HD, Win 7 Ultimate 64 Bit

User avatar
John Gray
PlatinumLounger
Posts: 5408
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: Physical & Virtual Memory - or Why Should 2+2=5 ?

Post by John Gray »

My 4GB Toshiba laptop running W7Pro 32-bit can only see 2.75GB of RAM. Usually it's 3 ± 0.25 GB...
John Gray

"(or one of the team)" - how your appointment letter indicates you won't be seeing the Consultant...