Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I run Windows, I usually keep multiple programs open at all times. I have 4GB of memory installed (and capable of using all of it), and it hardly every uses more than 2.5 gigs. Yet, every time I switch to a program that has been minimized for a while, Windows goes crazy trying to read the hard drive. I'm no expert in operating systems, but from what I understand, it shouldn't use the hard drive to cache memory and delete it from RAM if it's still in use and there's enough for other programs. In any case, is there a way to force Windows not to do this, or another explanation to why this happens?

Thanks!

share|improve this question
    
As another example, usual Linux distributions do not swap out anything until the RAM is almost full, which seems to avoid this problem at all. Maybe Windows could be switched to this behaviour too. –  dronus Mar 10 '13 at 17:48
add comment

migrated from stackoverflow.com Mar 5 '12 at 4:46

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 1 down vote accepted

Windows swaps out application data not used for a while to free the RAM for file caches. Thus file operating applications like media players or download tools may use your RAM in favor of running but unnused applications, which react slow then.

Most people tweak the other way round, icnreasing file caching for time critical read / write purposes. For example some hints are here: http://smallvoid.com/article/winnt-system-cache.html . Maybe you could use this explanations to tune it the other way round, eg. reduce file system cacheing in favor of not swapping out your applications.

share|improve this answer
    
I do not think that these items any longer effect the win7 system?? I have been messing with LargesystemCache settings, and they dont seem to do anything anymore. There is also "fsutil behavior set memoryusage" which still changes in 7 but does not seem to do a whole lot different anymore either. Turning off Superfetch can relieve a fair chunk of memory. but if this is the old "page minimised" problem they had back in XP (which i was told they had "fixed") only not minimising fixed that. I am really interested in any reality that is being seen, in all of these items. –  Psycogeek Mar 5 '12 at 7:37
    
A update to the windows 7 system, as put out by MS, also changed some of the behavior supposedly, by reducing the quantity of systems cache/ram use method overall, making getting any real user information very difficult, when it changed , what some say is completly different. The web data reflects 2 completly different sides to the system memory use, as if the users data is reversed, depending –  Psycogeek Mar 5 '12 at 7:39
add comment

In Windows 7 go to "System Properties". In advanced tab click "Settings" of "Performance" section. Here under "Processor Scheduling" select "Adjust for .." "Background services".

This is only based on personal experience and I can't confirm or quote exact reference into MSDN or some other published source. BTW, just clarifying that my personal experience is fairly significant as I have managed many servers and workstations over the years.

My theory is that by adjusting for "background services", windows keeps the background apps (including minimized ones) at a decent priority and hence lessen their chance of getting swapped out.

One more from very "vague" memory of reading about swap file.. Even the EXE's get swapped out, i.e. if a process is not actively using portions of its executable code, then that portion may be swapped out (not not really written to swap file). In other words, RAM used to hold code (as opposed to data) is also freed up and used for other processes. Later when you switch to the app, and it runs a portion of its code that is no longer in memory, Windows has to then reload it as needed. This causes a lag as well. I believe setting for background services also reduces this effect.

Secondly, since you don't use more than 2.5 G of memory, you could make the swap file as minimal as windows will allow without pain (leave enough for it to be able to write small memory dump in case of BSOD).

You can completely remove the pagefile but I don't advise that because as I mentioned above, windows will complain about not being able to write a crashdump.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.