Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Use Not Reduced As Files Are Removed From Ram Disk #7

Open
MovieWiz opened this issue Nov 10, 2024 · 3 comments
Open

Memory Use Not Reduced As Files Are Removed From Ram Disk #7

MovieWiz opened this issue Nov 10, 2024 · 3 comments

Comments

@MovieWiz
Copy link

Very interesting project you took on here. I got it working on Windows 11 24H2. And I definitely saw that memory allocated dynamically as I added 15GB of files to the ramdisk. However, I did not see the memory usage (in Task Manager) come back down after I deleted the 15GB of files from the RamDisk. I waited several minutes and the memory usage stayed the same. Not sure if this is the expected behaviour or if freeing the the memory was not something you had time to implement. I didn't see any settings that might be relevant to this.

Anyway, if you ever have time to work on the project again, I will definitely test it out again.

@tmcdos
Copy link
Owner

tmcdos commented Nov 10, 2024

Hi and thank you for finding my project useful!
I am not so good with C/C++ (that's why I used Object Pascal) so once I got the GUI stable I have not checked the updated CLI tool which accompanies the newer versions of the Arsenal driver. I don't think that there is a way to tell the driver to free the unused memory - at least back then when I reached a stable GUI and switched from ImDisk to this GUI.
It might be possible in the latest driver + CLI tool combination but I do not have the time to dig into C/C++ sources to discover.
In my personal opinion and for my own usage it seems just fine if the RAM-disk uses as much memory as I configure it for, even if it is reserved upfront rather than dynamically. When I had only 8GB of RAM - my RAM-disk was 1GB. When I got 16GB of RAM - my RAM-disk was 2.5 GB. Now, when I have 64GB of RAM - my RAM-disk is 16 GB and I don't care if it uses all 16GB during all day, there is still plenty of RAM for my daily usage.
I totally understand that you or someone else may have different needs and could prefer dynamic allocation. However, I am not aware whether the driver supports this feature at all, and if yes - I currently do not know how to tell the driver to enter such mode.
Maybe I will find some free time some day to explore this but until then - we should wait for someone to scratch his own itch and contribute the solution back :)))

@MovieWiz
Copy link
Author

Hello. Wow. Thanks for getting back.

I sort of figured that it was something like that. Thanks for confirming that I wasn't doing something wrong.

This whole refusing to run exe files on IMDisk Ramdisk is a rather annoying wrinkle in Windows 11 24H2.

On my 32 GB desktop, I configure the RamDIsk with 20 GB of dynamic memory. I used it mainly for TEMP files (which were never very large) and temporary storage when editing large video files (mostly from my TV tuner/dvr PCIe card). The dynamic memory allocation in IMDisk Ramdisk was perfect for this since I'd get the memory back when I was done with the large temporary files.

Oh well. I'm not ready to pay the hefty price for Primo RamDisk yet (I'd need at least the pro version). So, I'm keeping the IMDisk Ramdisk and I've just put the TEMP files back on my Drive C SSD for now. Sooner or later, there will be a free or more economical ramdisk alternative that both has dynamic memory and doesn't offend Microsoft.

I almost wonder if Microsoft did this by accident since it doesn't seem to serve any obvious security objective. Maybe this problem will just disappear in one of the upcoming monthly Windows updates.

@tmcdos
Copy link
Owner

tmcdos commented Nov 10, 2024

Oh, these newer EXE's are annoying not just on Win11 but on Win7, too!
I have tried to explain the problem in the README but the explanation is probably too technical.
Newer EXE's usually use the WinAPI function GetFinalPathNameByHandle to resolve symlinks (junction points).
Since ImDisk uses Direct-IO and thus bypasses the Volume Manager - ImDisk can not be reached/queried by the Volume Manager when GetFinalPathNameByHandle is called/invoked.
The Arsenal driver is a regular SCSI miniport driver - so it can be queried by the Volume Manager when any EXE calls GetFinalPathNameByHandle WinAPI function.
I am using the RAM-disk as a storage for TEMP folder and for data folders of Chrome and Firefox which like to create a lot of cache files - and I don't want my SDD to wear out because of the unfriendly browsers.
I also use the RAM-disk for my JavaScript projects where NPM or Yarn install hundreds and thousands of packages and tens of thousands of files during development - and I don't want these to wear out my SSD.
If you don't want to pay for another RAM-disk software then perhaps you would like to consider buying another 32GB of RAM?
I do not constantly monitor my RAM usage but I believe it stays below 30% most of the time, often even below 10%.
So the trade-off between ImDisk dynamic RAM allocation and Arsenal fixed allocation (but being able to run Chrome and other problematic EXE's) is worth for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants