<div dir="ltr">Hi Alexander,<div><br></div><div>Thanks for the prompt reply. The issue with giving less memory to the VM is that sometimes the VM needs higher memory which it releases at a later point of time.</div><div>My understanding is that the limits specified in the VM settings get accounted for as a "reservation" for the physical memory for the VM. The allocations still happen on a demand basis in units of chunks (2 MB). Isn't this understanding correct? Also, there is a free chunk worker implemented in GMMR0.cpp which tries to free up the chunks based on some heuristics (like all pages of the chunk are released and the chunks in the previous node and next node of the free list are also empty). Currently, this free chunk worker releases memory to the host only if the VM shuts down. Isn't it possible to trigger this based on a special guest hypercall, or some event?</div><div><br></div><div>Regards,</div><div>Vivek</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 20, 2020 at 8:20 PM Alexander Rudnev <<a href="mailto:alexander.rudnev@oracle.com">alexander.rudnev@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Vivek,<br>
<br>
VirtualBox allocates physical (non-swappable) memory with the amount set <br>
in VM settings. This memory can't be returned back to the host nor fully <br>
nor partially. Why don't you want to specify 1Gb of RAM in VM settings <br>
having your VM requires less? That seems as a solution to me.<br>
<br>
On 20/11/2020 14:10, Vivek Thakkar wrote:<br>
> Hi,<br>
> <br>
> We are running a 32 bit linux guest on a 64 bit windows host using <br>
> VBox.  Although the guest is configured with 4 GB RAM, it usually <br>
> consumes around 700-800 MB in steady state. However, during bootup the <br>
> guest may use around 1.5 GB RAM. Even otherwise, we expect that there <br>
> would be some peak memory usage that may happen in the guest but in a <br>
> steady state very less memory would be used.<br>
> Currently, the VBox doesn't seem to free up the memory (allocated for <br>
> the guest context) to the host even if the peak load has passed as there <br>
> is no guest to host interface that would tell the hypervisor to free up <br>
> the memory. If we are okay with paravirtualization of the guest, would <br>
> it be possible to modify VBox to release this memory to the host? How <br>
> can we do it - any pointers on this would be really helpful.<br>
> <br>
> Our main objective is to release the memory pressure on the host, so <br>
> that it doesn't impact the system performance (other apps on the host <br>
> can use the extra memory for its allocations without paging).<br>
> <br>
> Regards,<br>
> Vivek<br>
> <br>
> _______________________________________________<br>
> vbox-dev mailing list<br>
> <a href="mailto:vbox-dev@virtualbox.org" target="_blank">vbox-dev@virtualbox.org</a><br>
> <a href="https://www.virtualbox.org/mailman/listinfo/vbox-dev" rel="noreferrer" target="_blank">https://www.virtualbox.org/mailman/listinfo/vbox-dev</a><br>
> <br>
<br>
-- <br>
Alexander Rudnev | VirtualBox | work  +7 (812) 334 60 01 | cell +7 (921) <br>
951 82 04<br>
Oracle Development SPB<br>
Chkalovsky pr. 50, Saint-Petersburg, 197136, Russia<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">-Vivek</div>