Option for minimum RAM disk size in dynamic memory allocation

2 posts

Kambiz Guest
19 Apr

Hi,
Thanks for the Dynamic memory allocation feature. I am wondering if there is a possibility to set a minimum RAM disk size, so the system does not need to resize the RAM disk all the time. I have found a way around by not using the TRIM option.

Also, if there is a possibility to increase the RAM disk size until the next reboot, as sometimes I need a larger RAM disk to do one task, like the installation of a large program. This way I can increase my RAM disk size only for that session, and after that, by the next boot, I can go back to my normal RAM disk size.

Thanks in advance for your response

Andrew SoftPerfect
19 Apr

On a minimum size: there's no option for this, and unfortunately it wouldn't help even if there were. Writes can land on any part of the address space, so pre-allocating a minimum range doesn't guarantee it will actually be used. For example, with a 2 GB disk and a 1 GB minimum covering the 0–1 GB range, a file written to the 1–2 GB range forces the driver to allocate fresh memory anyway, and the pre-allocated block is effectively wasted.

That's why there are really only two sensible modes:

  • Dynamic allocation alone, where memory grows as needed but stays allocated until reboot, so eventually the whole disk is backed by RAM.
  • Dynamic allocation with TRIM, where the memory unused for a couple of minutes is released back to the system. The short delay avoids churn when files are created and deleted rapidly, and there is genuinely no downside to keeping TRIM on, as memory is returned when not needed and re-allocated when it is.

On increasing the size only for a session: this isn't something we can offer at the moment. Temporary resizing gets tricky because, for instance, an image backing file would have to grow with the disk and can't then be shrunk mid-session.

For your use case, the cleanest approach is actually already supported: create a dynamically allocated RAM disk with TRIM enabled, sized close to your total RAM (for example, 16 GB). Until you write to it, its real memory footprint is zero: it only grows as you write files and shrinks shortly after they are deleted. That's the most efficient setup and what we recommend.

Reply
Shown with your post. Sign in to keep the same name every time.
(optional, never shown)
Only needed if you want notifications about replies.
Drag files here, paste a screenshot, or . Images up to 10 MB. Text, log and zip files up to 2 MB. Up to 5 files per post.
You can edit your post until someone replies.