bhyve bhyve memory leak

ikevin8me

Active Member

Reaction score: 12
Messages: 198

I notice that there is substantial memory leak after using and shutting down a bhyve VM (in particular, I'm testing with OpenBSD guests).

Starting from a freshly booted FreeBSD host (v.13), the Wired memory is about 500 MB, and after running the VM and ...

- irregardless of setting the VM to -m "1G" or "4G"
- whether or not using the -S option
- whether or not using the -D option
- shutting the VM from inside the guest itself
- or calling "pkill bhyve" from the host
- including calling "bhyvectl --destroy --vm=vmname"

... there is still a substantial amounof of Wired memory used, and it seems to unclaimable.

Are other users experiencing the same thing?

I opened this thread as a discussion to understand it more...
 

cmoerz

Member

Reaction score: 35
Messages: 88

Are you sure that it's bhyve causing the memory consumption? Are you using ZFS as well? I've been using zvols with bhyve and I've noticed memory getting sucked up after a while even if I don't start any bhyve instance. However, usually memory gets freed again once other applications require more.
Right now, I've got 26G wired even though I didn't start any bhyve.
 

Alain De Vos

Daemon

Reaction score: 608
Messages: 2,056

The free-space ARC cache of zfs will never be wired memory.
What is the output of,
Code:
ps aux | sort -rn -k 6 | head | awk '{print $1,$5,$6,$11}'
 

PMc

Daemon

Reaction score: 671
Messages: 1,354

... there is still a substantial amounof of Wired memory used, and it seems to unclaimable.
Don't bother. It is unclaimable, at least I didn't find a means to influence it.
These are mostly buffers that get allocated when needed, and will not be freed until something else complains that it would need more memory. Unless you are actually low on memory, just ignore it.
 

dyokana

New Member


Messages: 1

I had a similar experience today with a FreeBSD 13 host, Virtualbox, and a Windows 10 guest.
 
Top