I'm having some trouble with the cleanup parameters... I've got a system with 256 Gbytes RAM, I create a dynamic ramdisk around 250 GBytes. If I copy some 20 Gbytes in there, no problem... But when I delete those files, ramdyn takes really forever to cleanup the now free RAM... I've been playing around with those paramters, but can't seem to figure out how to speed up reclaiming the unused blocks. Any ideas how to setup those paramters ? For info: I've setup the dynamic ramdisk with sectorsize 4096 bytes, clustersize 4096 bytes, blocksize 128 MB.. (Perhaps these settings are the reason for the slow cleanup ?) Many thanx in advance...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When triggered, the cleanup function fills the whole empty space of the file system. This means that it writes, in your case, 250 GB of data.
So, my suggestions:
- If you have Windows 7 or later, use the TRIM notifications (in command line, just replace the 4 parameters of the cleanup function by one parameter set to -1).
- If you cannot use TRIM, reduce the number of times it is triggered by increasing the CleanRatio (for instance, with 100, that is, 10%, it will be triggered only if you have at least 25 GB to free).
The TRIM notifications are the only (simple and documented) way to know where are located the deleted files. Otherwise, there is no choice: wipe the whole empty space.
By the way, unless you write only large files, I think you should not use such big block size. The only benefit to use large block sizes is to reduce the number of calls to the functions used to allocate and free the memory. But the downside is to increase the required memory, especially with a fragmented file system. And if you use "physical memory", this can even be slightly slower for read and write operations, because there are more pages to "map" into the virtual space of the process.
Even with your amount of RAM and if you use only very large files, i doubt that going beyond 8 or 16MB is very interesting.
Last edit: v77 2016-10-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for your answer. Well, I'm using it for Virtual Machines, which only use a few, but large files :-) I'm well aware of fragmentation-effects etc., but that's no issue in my case, so doing this on purpose... I normally was using 32MB, but was now experimenting on the effect choosing bigger. I'll try smaller aswell as you suggested. I'm using the registry + the service at startup to get it setup, so would that mean just simply ommiting all but one of those four parameters in the registry and setting that last one to -1 in registry would give the same effect that it would use trim ? How would I know if I can use trim ? The Hypervisor is "trim-aware" and will use it if available on the "storage", but I regularly delete files manually aswell (eg. explorer, and that will only utilize trim if the "storage" supports it. Actually the storage itself does the trim in that case, so that would mean the ImDisk-driver should do the trimming itself ? I'm using dynamic and AWE (because, as I understood it, I want to avoid paging at all times)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
TRIM is available for all NTFS volumes on Windows 7 and later. Anyhow, there is no risk to make a test, and you will see whether the memory is freed or not (the system can take a few seconds before sending the TRIM notifications).
You can also try the following command to check if it has not been disabled: fsutil behavior query disabledeletenotify
(0 = TRIM enabled)
With the registry, "DynMethod" must be set to either 0 (automatic) or 1 (force TRIM).
Of course, if you force TRIM and the system does not send the notifications, the memory will not be freed. So I would recommend the value 0.
If TRIM is used, the 4 parameters ("CleanRatio", "CleanTimer", "CleanMargin" and "MaxActivity") are ignored.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was keeping track of ImDisk versions, not ImDiskTk versions, so didn't realize Trim (big improvement over the cleanup) and NTFS Compression (I do this very carefully selectively on certain folders on the RamDisk) were supported now aswell :-) These 2 improvements, together with your explanation made my goal of max. performance for my specific target-scenarios a whole lot better yet again !
Thank you very much !
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm having some trouble with the cleanup parameters... I've got a system with 256 Gbytes RAM, I create a dynamic ramdisk around 250 GBytes. If I copy some 20 Gbytes in there, no problem... But when I delete those files, ramdyn takes really forever to cleanup the now free RAM... I've been playing around with those paramters, but can't seem to figure out how to speed up reclaiming the unused blocks. Any ideas how to setup those paramters ? For info: I've setup the dynamic ramdisk with sectorsize 4096 bytes, clustersize 4096 bytes, blocksize 128 MB.. (Perhaps these settings are the reason for the slow cleanup ?) Many thanx in advance...
When triggered, the cleanup function fills the whole empty space of the file system. This means that it writes, in your case, 250 GB of data.
So, my suggestions:
- If you have Windows 7 or later, use the TRIM notifications (in command line, just replace the 4 parameters of the cleanup function by one parameter set to -1).
- If you cannot use TRIM, reduce the number of times it is triggered by increasing the CleanRatio (for instance, with 100, that is, 10%, it will be triggered only if you have at least 25 GB to free).
The TRIM notifications are the only (simple and documented) way to know where are located the deleted files. Otherwise, there is no choice: wipe the whole empty space.
By the way, unless you write only large files, I think you should not use such big block size. The only benefit to use large block sizes is to reduce the number of calls to the functions used to allocate and free the memory. But the downside is to increase the required memory, especially with a fragmented file system. And if you use "physical memory", this can even be slightly slower for read and write operations, because there are more pages to "map" into the virtual space of the process.
Even with your amount of RAM and if you use only very large files, i doubt that going beyond 8 or 16MB is very interesting.
Last edit: v77 2016-10-12
Thank you for your answer. Well, I'm using it for Virtual Machines, which only use a few, but large files :-) I'm well aware of fragmentation-effects etc., but that's no issue in my case, so doing this on purpose... I normally was using 32MB, but was now experimenting on the effect choosing bigger. I'll try smaller aswell as you suggested. I'm using the registry + the service at startup to get it setup, so would that mean just simply ommiting all but one of those four parameters in the registry and setting that last one to -1 in registry would give the same effect that it would use trim ? How would I know if I can use trim ? The Hypervisor is "trim-aware" and will use it if available on the "storage", but I regularly delete files manually aswell (eg. explorer, and that will only utilize trim if the "storage" supports it. Actually the storage itself does the trim in that case, so that would mean the ImDisk-driver should do the trimming itself ? I'm using dynamic and AWE (because, as I understood it, I want to avoid paging at all times)
TRIM is available for all NTFS volumes on Windows 7 and later. Anyhow, there is no risk to make a test, and you will see whether the memory is freed or not (the system can take a few seconds before sending the TRIM notifications).
You can also try the following command to check if it has not been disabled:
fsutil behavior query disabledeletenotify
(0 = TRIM enabled)
With the registry, "DynMethod" must be set to either 0 (automatic) or 1 (force TRIM).
Of course, if you force TRIM and the system does not send the notifications, the memory will not be freed. So I would recommend the value 0.
If TRIM is used, the 4 parameters ("CleanRatio", "CleanTimer", "CleanMargin" and "MaxActivity") are ignored.
I was keeping track of ImDisk versions, not ImDiskTk versions, so didn't realize Trim (big improvement over the cleanup) and NTFS Compression (I do this very carefully selectively on certain folders on the RamDisk) were supported now aswell :-) These 2 improvements, together with your explanation made my goal of max. performance for my specific target-scenarios a whole lot better yet again !
Thank you very much !