Windows

Tech Tip: Adjust the Level 2 cache setting


During Windows XP installation, Setup queries the system processor to determine the size of the Level 2 cache. However, it doesn't always succeed. When this happens, Setup configures a default setting of 256 KB in the registry.

If your computer has a larger Level 2 cache than Setup configured in the registry, your system won't perform optimally. To significantly increase the performance of your system, change the value in the registry to match your Level 2 cache.

Here's how:

  1. Launch the Registry Editor (Regedit.exe).
  2. Go to HKEY_LOCAL_MACHINE\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
    512 KB                       200
    1024 KB                     400
  5. Click OK and close the Registry Editor.

You may need to restart the system or log out of Windows XP for the change to take effect.

If you're not sure of the actual size of your system's Level 2 cache, copy this script and save it as L2Cache.vbs:

Set ProSet = GetObject("winmgmts:").InstancesOf("Win32_Processor")
For each Pro in ProSet
WScript.Echo "Level 2 Cache:" & "  " & Pro.L2CacheSize & " KB"
Next

Double-click the script to run it, and you'll see a dialog box that displays the size of your system's Level 2 cache.

Note: Editing the registry is risky, so be sure you have a verified backup before making any changes.

16 comments
knowledgebased
knowledgebased

I have an E8500 processor with 6MB of l2 cache. What registry value will represent this?

x-windows user
x-windows user

On my Core2Duo box, Vista Ultimate had a default hex of 0 (256). I changed it to a hex of 1000 (4096)and it's much snappier.

OldER Mycroft
OldER Mycroft

I'm with Ropes on this one, or at least I was until I ran this little adjustment myself. The Data Values get a bit confusing, which is saying something - they don't usually bother me. So: Your 6MB L2 cache is 6144KB but the HEX box ain't for a HEX entry, coz the resultant value in 'HEX' is 1800. Dunno quite what it is, it ain't HEX but that's what the 'value' is. By the way, your E8500 will now produce blistering performance - mine does! :D

OnTheRopes
OnTheRopes

I'll trust that you can do the math.

Bax2x
Bax2x

What would happen if one was to enter a L2 Cache value that was higher than the system claims to have?

Dumphrey
Dumphrey

but cpuinfo gave me the data i needed. My regisrty was set to 256, but I have 1024. Big difference in speed there. Made a nice difference in general tasks.

Bax2x
Bax2x

What does hex mean and why would I want to change it on my machine?

OnTheRopes
OnTheRopes

Available from http://www.freshdevices.com/. I recommend it. I had to register the software -provide my email address- to use it but all I ever get from Fresh Devices is notifications of updates, no spam. Fresh UI makes tweaking a LOT of different things a simple task. Edit: To change the L2 cache size with Fresh UI you simply input the correct size in Kilobytes, no hex value needed.

seanferd
seanferd

It was explained in the article.

OnTheRopes
OnTheRopes

It's a nice cap to the end of the day. :)

OldER Mycroft
OldER Mycroft

Still rebuilding my system back to what it was before the new system HDD. No matter how many times I've done this over the years, finding all those little gizmo's you used to have is achingly difficult to remember. Thanks OTR, all I'd found was TweakUI but just knew that wasn't what I wanted. ;)

Bax2x
Bax2x

Vista Home Premium. I put some info in my profile since everyone keeps asking me.

Bax2x
Bax2x

Sorry I'm new at this.