memory allocation / performance tuning question

3 views
Skip to first unread message

Tomek CEDRO

unread,
Nov 10, 2025, 9:59:27 AM (2 days ago) Nov 10
to FreeBSD Questions Mailing List
Hello world :-)

I have switched to a new machine recently (iCoreUltra9 96GB RAM 128GB
SWAP) with 14.3-RELEASE-p5 AMD64. But, just as on the older machine, I
still can see the issue that first run of bigger applications is a bit
slower and then application works relatively slow as compared to
killing the application and running again I can see improvement in
performance.

For instance right now starting vbox told me it cannot allocate
memory, while only 28GB RAM and 300MB of swap is in use. I have
unpaused vm and it went smooth ahead.

I suspect this may have something to do with memory allocation
settings? Maybe some other settings?

Is there a way to tune things ups?

Any hints welcome :-)
Tomek

--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info

Frank Leonhardt

unread,
Nov 10, 2025, 1:32:30 PM (2 days ago) Nov 10
to ques...@freebsd.org

I have one theory. The first time you run virtualbox the first it loads kernel modules (vbox*). Perhaps they’re trying to allocate large contiguous or wired memory regions for doing virtualbox stuff and triggering a bit of a fragmentation clear-up (and allocation errors). If you quit virtualbox the modules will remain resident in kernel memory so the second time around all is present and it doesn't have to shuffle stuff around. I think it also creates stuff in /dev that might lead to a some kind of virtual race condition. Also, if you're using the ZFS ARC, the first time around stuff won't be cached but it might be on the second attempt.

You could test this crazy theory by using kldload to bring in the modules one at a time (vboxdrv and vboxnet, and possibly vboxnetflt vboxnetadp), wait for things to settle and then run virtualbox.

Beware - I'm not a virtualbox expert but I've seen stuff like this with virtualisation all over the place - which is why I stick to jails :-) If you're luck an actual expert may be along later.

Regards, Frank.

Reply all
Reply to author
Forward
0 new messages