Help - Search - Members - Calendar
Full Version: Windows' insane caching behaviour
Hydrogenaudio Forums > Misc. > Off-Topic
oudalrich
Hello everyone,

whenever my XP Pro system reads a large (several 100 MB) file, be it for copying, transcoding, burning, or whatever, the system cache grows way out of proportion -- >400 MB on my 512 MB system. As a result, everything else in memory gets paged out and the machine becomes unusable. Switching between applications can take several minutes, and when I recently tried to type something into Firefox's search bar while copying a large file, drawing every single character took about two minutes!

Is there anything one can do to avoid this problem? I know the registered version of CachemanXP has an option to limit the cache size to a user-defined value, but I really don't feel like spending $25 to solve a problem that shouldn't be there in the first place. Sysinternals' CacheSet is free and can instantaneously reduce the cache to a sensible size, but after that it will grow again almost as fast.

So. Any ideas, anyone?
legg
There should be a registry key to limit the size, I'll search out.

Edit: I *think* this might be it:
http://www.winguides.com/registry/display.php/55/
oudalrich
QUOTE(legg @ Mar 20 2006, 05:48 PM)
There should be a registry key to limit the size, I'll search out.

Edit: I *think* this might be it:
http://www.winguides.com/registry/display.php/55/
*



Thanks legg, but IoPageLockLimit is not what I'm looking for. It does not affect the cache size -- or maybe it does in some way, but it can't be used to impose a limit.
Andavari
I don't know if this will be of any help:
CODE

Setting the L2 Cache to a higher value

1. Launch the Registry Editor (Regedit.exe).
2. Go to HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management
3. Double-click SecondLevelDataCache DWORD value.
4. Using the options below, change the value in the Value Data text box to a number that matches the size of your Level 2 cache. Then click OK. Level 2 cache Value Data setting
256 KB = 0   (Hexadecimal)
512 KB = 200 (Hexadecimal)
1024 KB = 400 (Hexadecimal)

Note: The default Windows installed setting is 256kb.
oudalrich
QUOTE(Andavari @ Mar 21 2006, 01:01 PM)
I don't know if this will be of any help:
(snip)

Thanks Andavari, but I'm afraid it won't. This setting pertains to the processor's L2 cache, which AFAIK has nothing to do with Windows' system cache.
I'm really starting to wonder whether I'm the only one with this problem. But it's been there on my current machine since day one, as on my previous computer. And I've seen it on some other systems as well. So maybe I'm just the only person bothered by it?
Andavari
Something else, taken from RegistryRobot:

Optimize file allocation size:
If you work with very large files or disk-intensive applications, you may find that you can speed up operations by changing the Contiguous File Allocation Size. Defragment your disks after applying the change.

Platforms: 95, 98, ME, NT4, 2000, XP
Administrator privileges required

Add's the DWORD value ContigFileAllocSize to the registry in:
HKLM\SYSTEM\CurrentControlSet\Control\FileSystem
changing its current data of (none) to 512.

Save as for example: ContigFileAllocSize.reg
CODE

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"ContigFileAllocSize"=dword:00000200
legg
OK, what cache actually grows out of proportion?

It sounds like the cache growing is the equivalent of the old vcache.

Perhaps, this one might be it:
http://technet2.microsoft.com/WindowsServe...7507b61033.mspx
oudalrich
QUOTE(legg @ Mar 21 2006, 05:50 PM)
OK, what cache actually grows out of proportion?

It sounds like the cache growing is the equivalent of the old vcache.

It is. AFAIK MS refers to it simply as the "system cache". Its current size is displayed in the task manager, "performance" tab.
QUOTE

That's a setting for Windows Server 2003. There is a similar setting for XP (accessible through the control panel) that controls whether the system cache or "programs" get more memory. On my machine, it's set to "programs".
rutra80
Is your system up to date? I'm on 2000 and I remember that before they released SP4 (or was it SP3), it was practically impossible to copy huge files (after some time of copying, too much was getting cached so you were getting "out of memory" message and copying was stopping). SP3 or SP4 fixed that (earlier there was also an article about registry-based workaround IIRC - you may want to search for it), so make sure that you have all the patches from Microsoft Update installed.
If it won't help, it looks to me like you're totally out of memory, 512MB should be sufficient in normal cases, but if there's a lot of stuff constantly running in the background, it may be using most of your RAM so there's few megabytes of free physical memory, and when you start to copy, things start to swap. For example when I had an ATI card on my 1GB box I had no problems at all, but as soon as I've put that card into a box with 256MB of RAM, the newest over-bloated Catalyst drivers which use .NET, ate most of these 256MB and I was facing problems similar to yours. So, see how much of physical RAM your system is using, maybe there's too much bloated software (FF with 666 plugins), or you're using some software which has serious memory-leaks (I remember older versions of ZoneAlarm eating hunderds megabytes of RAM after few hours of running), etc.
Also, did you check page-file size settings in System applet?
The last thing that comes to my mind ATM is that you may be running in PIO mode, so your CPU is doing all the data transfers and that could be the reason of such unnatural slowdowns...
oudalrich
QUOTE(rutra80 @ Mar 22 2006, 12:48 AM)
Is your system up to date?

Yes. All patches installed, latest drivers etc.
QUOTE
I'm on 2000 and I remember that before they released SP4 (or was it SP3), it was practically impossible to copy huge files (after some time of copying, too much was getting cached so you were getting "out of memory" message and copying was stopping). SP3 or SP4 fixed that (earlier there was also an article about registry-based workaround IIRC - you may want to search for it), so make sure that you have all the patches from Microsoft Update installed.

I think I had the same problem on a Win2000 SP4 machine, but I'm not sure. Anyway, my current system is up to date.
QUOTE
So, see how much of physical RAM your system is using, maybe there's too much bloated software (FF with 666 plugins), or you're using some software which has serious memory-leaks (I remember older versions of ZoneAlarm eating hunderds megabytes of RAM after few hours of running), etc.
Also, did you check page-file size settings in System applet?

I have absolutely 0 memory-related problems unless I copy large files. Right now the system's been running for several days without a reboot and there are several programs open (R, SPSS, FirstClass, foobar, XYplorer, Firefox with, let me count, 9 extensions), but I still have >180 MB free physical memory and a <360 MB pagefile.
QUOTE
The last thing that comes to my mind ATM is that you may be running in PIO mode, so your CPU is doing all the data transfers and that could be the reason of such unnatural slowdowns...

Nope, DMA all over. Drive gets defragmented on a regular basis too, btw.
oudalrich
Just in case anybody is still interested: obviously Symantec AntiVirus was to blame. I set its background scanner to only scan "modified" instead of the default "accessed and modified" files and the problem is gone. The bad thing is that now it doesn't check files before they are run. Guess I'll have to get a better anti-virus software package.
Andavari
Try before you buy!
It's interesting that an antivirus in this day and age would cause so much grief, it's like a flashback to the Win9x days.
oudalrich
QUOTE(Andavari @ Apr 10 2006, 07:36 PM) *

Try before you buy!
It's interesting that an antivirus in this day and age would cause so much grief, it's like a flashback to the Win9x days.

Luckily, I didn't buy it (I never would have). My employer wants me to use it and paid for the license. I'll try to convince our software guys to switch to Kaspersky.
mythosdawn
Avira AntiVir is pretty good. Fast and easy on the processes. Has a good track record on VirusBulletin as of late.
David Nordin
btw. neither of above "hacks" make for a measurable change of performance of any Windows OS where it was available.
Most hacks and tricks for XP are just tales that derive from the Win98 days and don't even trigger anything.

The actual interesting change you can do to Windows is change of HW.
qristus
I recommend NOD32, AFAIK it has the best track record of any program on Virus Bulletin. It is also very unintrusive (especially compared to the train wreck that is Symantec), and it's reasonably cheap.
David Nordin
*removed*
pepoluan
I myself use Avast! Antivirus.
cooky560
lol norton seems to cause all problems these days personally ive never had this, and ive owned every windows os from 3.11 up and regularly move files varying in size from a few mb to 20gig without slow down
Andavari
QUOTE(David Nordin @ May 30 2006, 03:43) *

btw. neither of above "hacks" make for a measurable change of performance of any Windows OS where it was available.

Agreed! Even in Win9x most "tweaks" "hacks" didn't really help anything and went completely unnoticed. With WinXP it's better to disable unnecessary services to features a person may never or rarely use, and to disable the Disney Land type themes.
PiezoTransducer
I've had a similar problem to the original post regarding reading corrupt AVI files. Windows Explorer tries to read metadata/stats, and will not GIVE UP and locks up until it finishes and concludes its nothing. Anyways I found something here that shows you how to turn it off, but it disables reading other things too, not just AVIs.
gameplaya15143
regsvr32 /u C:\windows\system32\shmedia.dll
smile.gif yup, that's the solution I used a long time ago.. mainly to combat XP stupidly 'forgetting' that I defaulted all folders to list view and trying to use that worthless 'filmstrip' view junk mad.gif

mp3infp is more useful anyways.. supports more formats wink.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.