Tutorial :Want Visual Studio 2010 stop using the drive when there's lots of RAM in Windows 7 64 bit



Question:

I will be upgrading my system to use 16GB of DDR3 RAM in a Windows 7 64 bit and Visual Studio 2010 Ultimate. CPU will be 6 cores 3.2Ghz. I do lots of compiles/day and my goal for VS is to show a web page within seconds after making a change in the code behind.

I noticed Visual Studio does a lot of I/O operations (from HD led) with the drive during its work. I would like to put everything VS needs in memory including the temporary folders, system files, my code, .. whatever. I just want VS to be blazing fast. My primary drive is an SSD, which is fast, and I even want VS to not use it. RAM is super fast compared with anything else.

I know VS 2010 is still 32bit so it will use max of 4GB however all the other opened apps (browser, Outlook, File Explorer..etc) can use whatever remains from the 12GB and let VS roam freely in its dedicated 4GB memory space.

My question: What settings and tweaks can I perform to Windows 7 and VS 2010 so that VS 2010 dedicates and uses as much memory as it can and block that away and so that it uses the hard drive as little as possible? Is Windows 7 64 & VS already optimized for that and not much else can be done. Would a RAM disk help? Think of this as if I am trying to eliminate the drive.

I am aware of higher probably of data loss with power loss but that's not a concern right now. Assume no external dependencies are present (database, network speed ...) which might slow VS. Disk defragmentation doesn't help much.


Solution:1

You already got what you are asking for. With that much RAM, you'll have a really big file system cache. Visible from Taskmgr.exe, Performance tab, Cached. Any disk writes that Visual Studio performs will completely instantaneously as data gets written to RAM. The cache manager will then lazily write it to disk, making your drive access light blink in the process of course.

Similarly, disk reads will speed up. It still has to come off the disk but it will read an entire track instead of just the file sector that Visual Studio asks for. Making it very likely that the next read will come out of RAM instead of having to be retrieved from the disk.

This works so well (and is secure) that RAM disks are no longer used.


Solution:2

It sounds like you need to first create a RAM disk. Not sure of tools to do this in Windows 7; maybe someone else will have an idea. But this should handle all the tweaking necessary on the Windows side, as far as the disk goes. The only thing I would add is setting your temporary directory onto the RAM disk. This is stored in environment variables as TMP and TEMP. It is also usually in both system and user variables; be sure to change both.

Within Visual Studio, you then need to make sure that everything you can set as path options in Visual Studio points to the RAM disk. This includes the project input and output directories, and any temporary directories it might need, though theoretically these should all be keyed off of the TMP/TEMP environment variables.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »