MSL Wiki
MSL on GitHub

Memory: dynamic mode

Start at a maximum and hand back whatever Linux isn't using, continuously.

Chapter 6 of 202 min read
On this page 4 sections

Dynamic memory gives an instance a Minimum and a Maximum. It starts with the maximum, and MSL keeps watching how much Linux actually needs, handing back what it isn't using and letting it have more again as it needs it — never above the maximum, never below the minimum.

Choosing the numbers#

  • Maximum is what your Mac sets aside when the instance starts, and the most it can ever have.
  • Minimum is as far down as MSL will ever squeeze it.

The same warnings as manual mode apply to the maximum, and the minimum can't be larger than the maximum.

How MSL decides#

Rather than guessing from one number, MSL looks at how much memory Linux is really using, how much it could free if it had to, and — most tellingly — whether programs inside are stalling while they wait for memory. It gives memory back gently when there's plenty spare, and returns it quickly the moment Linux starts to struggle. Linux images don't use swap, so MSL never squeezes an instance below what its programs are actually holding.

The live readout#

While a dynamic instance is running, the bottom of the card updates every few seconds:

RowMeaning
Allocated right nowWhat Linux currently has from your Mac.
Guest is usingWhat its programs are really using, out of what it can see.
Guest stalling on memoryThe share of time programs spend waiting for memory. Only shown when it isn't zero.
Last changeWhy MSL last moved the number, in words.
Adjustments this sessionHow many times it has moved since the instance started.

If the guest has swap turned on, a note says so: MSL still sizes it conservatively, but swap changes what running out of memory feels like.

When it takes effect#

Switching between Manual and Dynamic, or changing the numbers, applies at the next start — like every memory change.