Cumulative Virtual Memory as a physical RAM for VM

If it doesn't fit anywhere else, drop it in here. (not to be used as a chat/nonsense section)

Moderator: Moderator Team

Post Reply
zydon
Posts: 160
Joined: Tue Dec 18, 2007 9:03 am

Cumulative Virtual Memory as a physical RAM for VM

Post by zydon »

Please bare with me on this one. I can't shake it off this scenario from my mind today.

A Physical 1MB in a x86 machine could create sum of 4GB virtual memory when it's entering a 32 bit protected mode environment. What if we take these 4GB virtual memory and attach it into a Virtual Machine as a physical RAM, could it speed up the current available Virtual Machine software or run memory hungry guest OS? Or share it for a virtual GPU VRAM?

From a 1MB of physical RAM we could get a huge 4GB virtual memory as RAM, for a 64GB RAM requirement it just use 16MB physical RAM by binding and mapping together 16 Protected Modes environment or sandbox. Imagine when it can goes even further amount of RAM with 64 bit Protected Mode environment.

Is there a possibility for this to happened?
middings
Posts: 1073
Joined: Tue May 07, 2013 9:18 pm
Location: California, USA

Re: Cumulative Virtual Memory as a physical RAM for VM

Post by middings »

zydon wrote:Please (bear) with me on this one. I can't shake it off this scenario from my mind today.

A Physical 1MB in a x86 machine could create sum of 4GB virtual memory when it's entering a 32 bit protected mode environment. ...
Your idea shows that you have some understanding of the theory behind virtual memory. However, there are practical implementation requirements. A single-level page table required to map 4GB of virtual memory into a physical memory made up of 4096 byte pages would consume 4MB of physical RAM. There are tricks to reduce the amount of memory consumed. These tricks come at a cost of greatly increasing the time required to swap pages between high-speed RAM and the slower backing store (usually a disk drive).

See:
Cornell University computer science course CS4110, summer 2015, Lecture 14: Page tables.
OSDev.org article "Paging"
Wikipedia article "Page Table"
Intel 80386 Programmer's Reference Manual (may be available on the Web as a large PDF file)
Microsoft Windows Internals, 4th Edition, Chapter 7, Memory Management, pp.425-437; Mark E. Russinovich and David A. Solomon, authors.
Last edited by middings on Thu Jan 25, 2018 9:23 pm, edited 1 time in total.
zydon
Posts: 160
Joined: Tue Dec 18, 2007 9:03 am

Re: Cumulative Virtual Memory as a physical RAM for VM

Post by zydon »

Thanks @middings for the tech links. Quite an interesting reading.

So, it conclude that is I want a 4GB virtual memory, I have to use 5MB physical RAM and around 4.5GB of mass storage in a dummy x86 Protective Mode Virtual Machine to make the thing works. That could be possibly managed.

My concern is how to tell another VM that the 4GB RAM is available to be used and utilized as a physical RAM without taxing the Host physical RAM?

If this can be done, a small device such as Raspberry Pi with 1 GB RAM could run a full features of Win 7, 8 or 10 guest OS VM just with 10MB or less RAM to operate. Android too may do the same with uses of Micro SD storage.
karlexceed
Posts: 531
Joined: Thu Jan 10, 2013 6:17 pm
Contact:

Re: Cumulative Virtual Memory as a physical RAM for VM

Post by karlexceed »

Here's Windows 95 on an Apple Watch:
https://blog.tendigi.com/i-installed-wi ... 89fda5e36d
It's technically emulated, not virtualized (x86 on ARM), so it's a slower than it could be in theory, as the watch actually has specs comparable to a Win95 PC. It takes about an hour to boot up.

Here's Windows 95 on a RaspberryPi:
https://www.raspberrypi.org/forums/view ... hp?t=13161
Apparently it's "near usable", but again it's emulating x86 on an ARM CPU.

Better yet, MS released an official Windows 10 build for the RPi:
https://www.techrepublic.com/article/wi ... d-to-know/
Of course, it only runs UWP apps as most things aren't compiled to run on Windows on ARM.

Android runs just fine on an RPi:
https://www.raspberrypi.org/magpi/android-raspberry-pi/

So you can see, the real performance hit here is actually running x86 code on ARM. Most of these modern, small devices are quite capable hardware-wise.

As far as over-committing RAM to a VM (more RAM than the host has), it's certainly possible, but the performance hit once your VM is actively using more RAM than your host has is going to be terrible.

From https://stackoverflow.com/questions/137 ... n-the-disk:
...memory is only about 6 times faster when you're doing sequential access (350 Mvalues/sec for memory compared with 58 Mvalues/sec for disk); but it's about 100,000 times faster when you're doing random access.
jemir
Posts: 3
Joined: Wed Jun 14, 2017 7:03 am

Re: Cumulative Virtual Memory as a physical RAM for VM

Post by jemir »

karl, thanks a lot for sharing all these links here. They are really useful!
Hi!
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests