views:

91

answers:

3

What's up people.

Something's been bothering me for a while now... and I was wondering if any of you might know of a workaround for this.

The C# solution im working on is a huge solution that contains about 20 projects and almost the same amount of unit test projects. Each projects contains hundreds of files. So opening and closing the solution takes a while... but once it's opened, everything is fine.

But, if I leave my computer up for the night (with my solution still opened in VS) and come back the next morning, everything I'll do in VS will be very slow for the next half hour or so.

I know why this happens... it's because Windows seems to remove idle processes from memory (RAM). And when I do something in VS, it takes the data from the pagefile and puts it back in the memory which slows everything single operations I do till the process' memory has been fully restored in RAM.

So my question is, is there a way to tell Windows that VS is a high priority process/application and to leave that process' memory in RAM?

Thanks in advance,

-Oli

+2  A: 

I don't think this is possible. OTOH, you could put your computer in suspend-to-disk mode. That would pretty much freeze its state as it is when you leave (that is: VS in RAM) and restore it to the same when you start working. As an additional bonus, you would help to conserve energy and thus might save the earth.

sbi
Thanks for the tip... this is the easiest/most effective solution.I don't know why, but I always thought of "suspend-to-disk" to cause more problems than anything... yet again, the last I used that feature was back in the Win95/98 days and I had major issues with it if I remember correctly.
SuperOli
I only ever boot my laptop after I installed updates or when it acts starting funny. (Gotta be something left to envy the Mac guys for.) It's up much faster that way.
sbi
A: 

You could alter your VS shortcut according to this article to boost the priority, but I don't know whether it would do what you describe for the process' memory.

Also solely for performance sake you could consider getting an SSD drive to replace your hard drive, if you haven't already. A friend of mine showed me his new laptop with an SSD onboard and it booted into Windows under a minute, and opened VS in less than 5 seconds.

Granted that was opening VS straight from the start menu, opening that huge a project hopefully would at least be significantly faster.

Darth Continent
Yeah our tech team here is currently doing benchmarks and heavy testing on SSD drives to put our solutions and pagefile on. So far, the test results have been incredible! We're waiting to see if "the bosses" approve moving to SSD.
SuperOli
A: 

AFAIK, changing the process priority won't solve the problem, as the bottleneck seems to be I/O rather than CPU time. If the problem hurts your productivity, it would be well worth it to just buy a few more Gs of RAM (how much depends on your OS and budget). If you can get about 3-4GB of RAM, you can even eliminate the swap file (or close to eliminate it). This will prevent VS from sinking when idle.

Another option would be to create a tool that will walk VS's heap, forcing it into the main memory. This can be done by writing an add-in or by code injection. Have it run before you get to work, and you'll have VS up and about once you get to it. It will, however, require some work, and you might get more than you actually need in memory (some of VS's memory is in the swap file even when you work as usual, as with every other process).

eran
I like your "hack" ;) Pretty sure it would do the trick... but I just don't have the time to write it... so i'll stick to suspend-to-disk for now!
SuperOli