1

I am trying to synchronize the default user registry files by comparing their filesizes. Now, I have noticed that the size of NTUSER.DAT does not change when changing registry values.

Two questions:

  1. Why does the size not change?
  2. How can I force a size change?
Zulakis
  • 4,191
  • 14
  • 44
  • 75
  • Which part of the registry are you editing? In Windows XP there are several Registry files which are stored in \Windows\System32\Config\. These files are named software, system, SAM, security, default and userdiff. There is one more Registry file and **NTuser.dat**. This one is stored in the users folder under Documents and Settings. Each user has their own copy of this file. – Hennes Oct 13 '12 at 17:17
  • I am especially talking about NTUSER.dat, even though this behaviour mihgt occur on the other registry files too. – Zulakis Oct 13 '12 at 17:24
  • Just making sure you edited the right part of the registry. I think it is easy to edit one part and look at the wrong location (Been there, got the T-shirt myself :( ). -- As for the non size changing: Did it not grow or did it not shrink? I have no good references, but if I remember correctly the registry only grows bigger. Even if you delete items. Think of it as a book. When needed you add a page and the book gets bigger. When no longer needing that page it gets blanked but not removed. But that would only explain it if you deleted items. – Hennes Oct 13 '12 at 17:31
  • Yeah, it didn't shrink. I am looking for a way to have it shrink automatically or atleast manually. – Zulakis Oct 13 '12 at 17:33

1 Answers1

2

The Windows Registry is a hierarchical database that utilizes some variant of binary tree to manage its space and searches. When it has no more space in the node to add an extra setting the registry is expanded by allocation of a 4KB chunk of memory and in the backing file. It never frees the memory. Unfortunately, there is no API or a tool to squeeze this structure.

Serge
  • 388
  • 1
  • 4
  • Yay, that explains the growing. Its nice to have a technical reason for it, rather than a 'I never saw it shrink, it probably never will' feeling. At OP: There are some utilities out there which will shrink. If you want to do it manually: Exporting all values, logging into a new account (with a minimal NTuser.dat) and then reimporting values works. But it is a serious hassle to do all that. – Hennes Oct 15 '12 at 20:42
  • @Hennes this has one drawback provided you use RegEdit to export: the access rights will not be restored – Serge Oct 15 '12 at 20:48
  • I got the feeling that today is my learning day on both SU and SF. (Mostly due to reading other peoples posts and answers). – Hennes Oct 15 '12 at 20:50