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
Is this the right setup for RAM disk? #9
Comments
Yes, this is correct. This creates a RAM disk i physical memory. The problem is however that Visual Studio uses the temp directory a lot for intermediate files during build, so you will still get lots of writes to SSD unless you also relocate the temp directory to a RAM disk. |
I see, thanks. Do you mind if I keep this issue open until I try it? |
No problem, keep it open and come back with your findings later! |
It does not seem to take any significant effect, still compiling the whole project from scratch wasted about 600 megabytes (reported by host OS). Through Is there any other place MSVC could write to? Can compilation process trigger writes to virtual memory? I've got 8 gigabytes total on that computer, 6 for guest Windows 11 ARM (now 4,5 with RAM disk), and 2 for host OS (Macintosh OS). Both always at any time have at least 1 gigabyte of free RAM available (I do not run any other software neither on guest nor host besides MSVC), so it is not supposed to start using virtual memory (I hope so). |
I would suggest that you use Process Monitor to check what paths are written to and then try from there to analyze where those writes come from. |
Do you mean Process Monitor from Sysinternals? I have just tried it, excellent tool as it turns out, seems to be much better at showing what is going on with the disk than the built-in tools of Windows. It may take awhile, but I will share whatever I will have found. |
Yes exactly. It is the most widely used tool for these kinds of analysis on Windows systems. The tool is very actively developed and has been around for I think 20-25 years. It is really good. |
It appears that I have finally succeeded. Before I took all these measures, each day of work (around 8 - 10 hours) wasted more than 10 gigabytes, up to 20. Now it is no more than 4 gigabytes (9 hours 5 minutes of actively working one day - 3.78 gigabytes, and 11 hours 42 minutes of computer being mostly idle another day - 3.43 gigabytes). And that is for the whole system (guest OS + host OS). ImDisk was instrumental in achieving this, much appreciated! Such rate of writes is good, right? Although, perhaps I am overreacting? They say these SSDs can handle a lot of writes unlike USB sticks. Never had an SSD before (MacBook Air with M1 CPU), and dozens of HDDs that I had used have never failed me (some are as old as being back from the 90's, that apparently witnessed Windows 95, and whose manufacturers are long gone now). That is more than 20 years of exploitation for some of them, do SSDs serve as long, or at least 10 years? Here is a list of additional things apart from setting up RAMdisk that I did to minimise the number of writes, as promised. A few notes before I begin:
So, here they are:
I have disabled a lot of things, so I feared system might become unstable, but everything appears to work fine, at least for the single purpose of compiling software that I use this machine for, there are just a couple of small issues that do not affect my workflow. And if I am not bothering too much, I would like to ask a few more questions:
sc create imdisk type= kernel binpath= "C:\ImDisk\imdisk.sys"
sc start imdisk
sc create awealloc type= kernel binpath= "C:\ImDisk\awealloc.sys"
sc start awealloc Then I am manually launching imdisk.cpl to create the RAMDisk and format it. How do I automate this process so it does not have to be done manually each time ? In particular:
There is no need to save partition on shutdown, I simply plug in external HDD at the end of the work day and manually copy my progress there. |
First of all, I have laptops with Intel and Samsung SSD that are about 10 years old that I have not done anything with in particular to save them from excessive writes and they still work without any problems. Nowadays the problems should be even smaller with this. Some 15 years ago though there were frequently problems with SSD drives that failed after a few years of writing, I saw that often in embedded systems for example. Re: installing on ARM: Re: setting up for auto-creating a RAM disk at system startup, have a look at the FAQ: |
Excellent, thanks a lot! |
@T-640 What tool(s) were you using to measure the quantity of bytes read/written to your drives? |
@Gitoffthelawn For individual processes - Process Monitor from within the guest OS. For the total bytes written during the whole session - Activity Monitor from host OS (macOS). |
@T-640 Thanks! Do you happen to know if there is something like macOS's Activity Monitor, but for Windows? BTW, Process Monitor no longer works on some versions of Windows because it's developed by a Microsoft employee, who in my perception, toes the corporate line and wants to push people to buy the latest version of Microsoft products, regardless of the problematic consequences. |
You mean that Process Monitor no longer works on older versions of Windows? How old versions? |
Yes. I can confirm that it no longer even works on Windows 7. In a few years, I imagine it will no longer even work with Windows 10, as MS is pushing to move people onto Windows 11, and will likely push people harder and harder (using their typical FUD tactics - Fear, Uncertainty & Doubt ) to get people off of Windows 10. Ironically, the more they do this sort of nonsense, the more people switch to macOS or Linux. |
Ah, it is not surprising that no longer supported Windows versions do not work with latest versions of tools like that. It is a tool that use lots of internal "hacks" to retrieve various things and applications like that quickly become a mess if you try to support lots of different OS versions. But yes, as soon as Windows 10 is no longer supported in about four years I would expect less of latest versions of tools like that to work on Windows 10 as well. I would recommend that if you really want to run old and unsupported versions of Windows (or other OS) you really should keep old versions of tools and applications you need that are verified to work on that OS version because quite naturally, OS vendors quickly drop support for tools for unsupported versions. |
I wrote a nice & enjoyable (in my opinion!) response, but given that GitHub is now owned by MS, I'm not sure I want to post it here. ;) A few brief points from what I wrote:
|
I am afraid not, but before I discovered Activity Monitor I simply had used S.M.A.R.T. monitoring software to look at "Data Units Written" parameter right after booting and before shutting down. I used smartctl in particular.
In case you have lost the version you need you can always download it from the Internet Archive's Wayback Machine On a side note, I am happy to see that ImDisk still supports Windows XP! |
ImDisk supports Windows versions all the way back to Windows NT 3.51 (with some features missing). It has not been actively developed for some years now and will be kept the way it currently is to provide an alternative for people who for various reasons use older Windows versions. We have Arsenal Image Mounter as an alternative for modern Windows versions and that is actively developed and new features are added there instead. |
That's a great idea, and simple to automate. Thank you!
Another solid idea! I'm always saving things to the Wayback Machine so myself and others will be able to access the content in the future. There are some good browser extensions that make the process even faster.
It's great that it still supports it. I bet RAM is cheap for old XP boxes, so people may be able to find uses for those old machines, especially if they are invigorated by the speed of a RAM drive. As long as XP boxes are used offline and not connected to a network or the internet, they should still work well. |
I spoke with someone recently, who by chance, uses Arsenal Image Mounter. They are quite pleased with it! |
Glad to hear that! I use it a lot myself. I have almost not used ImDisk at all for several years now and since I am not actively working on it, I start to forget more and more how it was designed. I also recommend everyone who can to switch to Arsenal Image Mounter instead. |
ImDisk is also frequently used on XP to mount iso images as virtual DVD since there is no built-in support for that on XP. |
I have decided to create RAM disk to relieve some pressure from SDD drive when compiling software to prevent wear out, but still something is writing a lot to the SSD during the compilation process with MSVC, despite the whole project being put in a RAM drive and compiled from there. The fact that it is done inside virtual machine is irrelevant, right?
I would like to make sure that I have correctly set up imDisk for this task. Could you take a look at the following screenshot and commands and tell that it indeed creates a partition in RAM and not anywhere else (like in the virtual memory of pagefile)?
Manually starting these drivers due to #8:
Then executing the cpl file:
The text was updated successfully, but these errors were encountered: