Monday, December 22, 2014

The system has reached the maximum size allowed for the system part of the registry

The system has reached the maximum size allowed for the system part of the registry. Additional storage requests will be ignored

If you get this error on a machine it's a major annoyance. There are plenty of potential issues as to why this may be happening, but I'm not going to get into those. This article is going to assume that the registry truly has reached it's breaking point through normal means. Also, as a disclaimer, messing with your registry without understanding what you're doing is very dangerous so if you do continue with this process be careful. This article is my version of MS KB 2498915

The trick to reducing the size of your registry files is to open them within regedit without having your main OS running and exporting them. You can do this with a WinPE boot disk if the device is a physical machine. In my case the server was actually a VMWare ESXi client, and the WinPE disk wouldn't boot. In that case what I did is shut down my server and open the virtual hard drive on another ESXi client to gain access to the files.This created a new problem, but it was fixable. Make sure to check that link beforehand if you'll be doing the same in a ESXi environment.

The files you need access to are in the C:\Windows\system32\config directory: Software, System, Default, etc. These are your registry files. Whether you boot from WinPE or use a 2nd computer, those files remain the same. However, you can look at those registry files to see what their sizes are. Whichever one is the largest is the one I would suggest starting with. In my example I'll assume you're shrinking the software hive too, but you can repeat these steps for any of the registry hive files.

In my case, the software file was 3-4x larger than any of the others so that's where I suspected I had the most free space to reclaim. Once you have access to the registry files through WinPE or a 2nd computer, open regedit.

Once regedit is open, click on HKEY_LOCAL_MACHINE to select it and then go to File->Load Hive... This will open a file dialog box, and here you'll want to navigate to the registry files directory from above and open the hive, which in this case we're using software. You will be prompted to give it a temporary name, which you can use whatever you'd like to refer to it. In my case I used the name toshrink.

After the hive has loaded, select it and go to File->Export... and save it somewhere. Do not overwrite the existing hive, just in case you need it again. Something like softwarecompressed would be a good name. At this point you'll have to let regedit run, and it could take a while. My software hive was ~180MB and it ran for somewhere between 30-60 minutes before completing. Smaller will run faster of course.

After the export process has completed, close regedit and then reopen it. Once it is open again, click the hive you loaded in HKLM and go to File->Unload Hive... This will unload it from the registry.

Now go to the location of your newly compressed hive file. In our example we have softwarecompressed, which should be smaller than the software hive we started with. Rename software to software_orig, and rename softwarecompressed to software. Place the compressed and newly renamed file into the C:\Windows\system32\config folder and then reboot your machine normally. This should load the system with the compressed hive file, and get rid of your maximum size allowed error.

For me the software hive was 192MB, and after this process it was 133MB. The other hives didn't shrink enough to make it worthwhile, but the compression on the software hive was significant.

Good luck


No comments: