Re: bhyve: how to keep the host from starving the guest

From: Vitaliy Gusev <>
Date: Mon, 26 Jun 2023 11:49:55 UTC
Hi Aryeh,

Have you wired a guest memory with bhyve's -S option?

-S          Wire guest memory

Anyway, OS does not have another choice than kill a process to free some memory
when RAM+swap is fully used (assume kernel already scanned Inactive memory).

As recommendation:
Look at an another memory consumers like ZFS, another processes
Increase swap
Tune vm.overcommit sysctl. See tuning(7) for details.

So in short, there is no good way to run applications that fully use 10 GB
memory on a systems with just 1 GB RAM + 1 GB swap. You should have
enough resources to do that.

And it would be nice, if you provide more information and metrics for your
system, total RAM, memory assigned for VM,  additional statistics for all
intensive processes (SIZE, RES), etc.

Vitaliy Gusev

> On 26 Jun 2023, at 13:44, Aryeh Friedman <> wrote:
> I am a 12 core machine that I want allocate only 4 CPU's to the host
> and 8 to a VM (the host is my desktop FreeBSD machine and the guest is
> debian 11 used for playing around with learning AI model making).... I
> have passed my GeForce 1030 (bottom of the line GPU for AI work it
> seems) but since it appears that no one can get tensorflow, pytorch or
> anything else that runs ANN's on a GPU to work on FreeBSD (I have
> tracked down to the fact nvidia never ported CUDA to FreeBSD)... the
> problem is sometimes during heavy work on the guest then the host
> slows down and if the the host is doing heavy work (especially
> resource intensive things like compiling lang/rust) that the host will
> kill the guest if it runs out of available memory+swap (speaking of
> that does wiring the memory at least prevent this?)
> -- 
> Aryeh M. Friedman, Lead Developer,