Memory reclamation fails after deleting large file

2 posts

inBeLight
8 Oct

Chinese: 我全新安装了最新版RAMDisk,当删除其中一个50G的文件后,内存回收不展开,我必须在设置中取消“动态内存”选项,确定后,再打开设置并重新选中“动态内存”选项,确定,这样才可以正常回收删除文件后的内存。但另一个问题是RAMDISK回收内存的速度需要2分钟以上,而不上马上。测试文件大小为50G,分配给RAMDISK的内存为56G。希望改进这一问题。

对了,系统是Windows 2025

English: I did a clean install of the latest version of RAMDisk. After deleting a 50 GB file from it, memory reclamation doesn't kick in. I have to go into the settings, untick the "dynamic memory" option, click OK, then open the settings again, tick "dynamic memory" again and click OK. Only then is the memory from the deleted file reclaimed properly. The other problem is that RAMDisk takes more than 2 minutes to reclaim the memory, rather than doing it immediately. The test file was 50 GB, and the memory allocated to the RAMDisk is 56 GB. I hope this can be improved.

My system is Windows 2025

Automatic translation from Chinese

I did a clean install of the latest version of RAMDisk. After deleting a 50 GB file from it, memory reclamation doesn't kick in. I have to go into the settings, untick the "dynamic memory" option, click OK, then open the settings again, tick "dynamic memory" again and click OK. Only then is the memory from the deleted file reclaimed properly. The other problem is that RAMDisk takes more than 2 minutes to reclaim the memory, rather than doing it immediately. The test file was 50 GB, and the memory allocated to the RAMDisk is 56 GB. I hope this can be improved.

By the way, the system is Windows 2025

Andrew SoftPerfect
8 Oct

There are two separate things here:

1. Memory not released at all. On Windows, a RAM disk gives memory back only on NTFS and exFAT. FAT and FAT32 don't report deleted space to the disk, so on those the memory stays allocated until the disk is removed. The disk also needs Automatically release memory (TRIM) ticked alongside Dynamic memory allocation.

One note on your workaround: unticking and re-ticking the dynamic memory option doesn't trigger a release. Changing a disk's settings remounts it, and a disk without an image file is created from scratch when that happens, so the memory comes back simply because the disk is empty again.

2. Speed. What we shortened in version 26.7 is the delay before the release starts: about 10 to 15 seconds on NTFS, and around half a minute on exFAT. The release itself then runs gradually in the background, wiping each block before handing it back to Windows, at roughly half a gigabyte per second. So about two minutes for a 50 GB file is what the current version is expected to do, just as you saw it on your system. Small deletions finish almost instantaneously, while the very large ones will of course be noticeable.

If immediate release matters for your workload, RAM File System is the better fit, as you noticed yourself last time. It is a file system driver rather than a virtual disk, so it doesn't depend on Windows sending TRIM at all. It knows the file is gone the moment you delete it and returns the memory straight away, whatever the file size. The two are compared side by side here: RAM Disk vs RAM File System: which should you choose?

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.