0

On a Windows 10 OS system, I have installed VirtualBox with 4 GB RAM, using CentOs 7 as its OS. Turning on the VM, the RAM utilization of the host OS increases as expected to a certain level (the system overall has 8 GB RAM).

I expect that the VM OS has its RAM quota (4 GB), and any applications started inside the VM will use its RAM and leave the host OS alone.

However, when I run docker inside the VM, the overall RAM consumption of the entire system increases, and when I start a few java based containers inside the VM, RAM consumption of the system increases again. I repeated this experiment and observations were similar.

I am slightly confused by this behaviour. I would have expected that once the VM starts with its host OS, it will reserve 4 GB memory for itself, and any applications started inside (docker etc.) will use RAM reserved for the VM, but I see the host or system RAM consumption increasing instead.

I observed the increased RAM consumption in task manager of Windows 10 and in Resmon.

Is it possible that docker or java applications started inside the Linux VM somehow see the whole system memory available for use and try ad use that instead? I'd have thought it would not happen since a VM provides quite a level of isolation from the host OS.

If the behaviour is, that the Linux OS takes less RAM in the beginning upon startup and only increases when there are applications inside the VM demanding more, is it reasonable to expect that whatever be the state of the applications, RAM consumption of the VM will not increase beyond the 4 GB quota allocated to it?

1 Answer 1

2

No, the VM doesn't reserve all the RAM it can potentially use. Its RAM is allocated as needed. It is not uncommon in data centers that the cumulated RAM of the VMs running on a server far exceeds the actual hardware RAM size.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .