Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Registry fragmentation?

Status
Not open for further replies.

cpjust

Programmer
Sep 23, 2003
2,132
0
0
US
Hi,
I know the basics of accessing/modifying the registry either with regedit or using the Windows API functions, but I don't know much about the inner workings of how Windows physically stores the registry (I know where the files are though).

I've read some sites that sell Registry Optimization tools claim that they both clean up useless entries in the registry and also defragment the registry.

I'm wondering if anyone knows whether there is much truth in that, and if so, how does the registry become fragmented? Does Windows itself ever try to defragment the registry?
 
As any file that is written to the HDD, it can become defragmented...

Windows in itself does not defragment it...

Third party Registry Cleaners (ie. Registry Healer, JV16 Powertools) do clean up the registry and MAY defrag it by rewriting it onto the drive...

before spending money I would suggest that you look into FREEWARE progs (NTREGOPT - short for NT REGISTRY OPTIMISATION) works like a charm and is clean...


Ben

"If it works don't fix it! If it doesn't use a sledgehammer..."
 
Windows Registry Tutorial



If you are delving into the Registry these may be handy to know about.

Registry Backup and Restore for Windows NT/2000/2003/XP

An easy to follow recovery console description when unable to start computer due to corrupt registry.

This is a layman's version of Q307545 in simple language.

The best Registry tool (not free) is JV16 Power Tools available from
A decent free one is RegSeeker

Over time bits and pieces are added to the Registry via the install of programs and the general running of Windows. Some of these entries are useless and redundant, the trick is knowing exactly which are. The best advise however is to leave the Registry alone.
 
I know the actual registry files can get fragmented just like any file on the disk, but I'm just talking about the data in the file being fragmented.

For example, lets say a file looks like this:
AAAAAAAAAAAAAABBBBBBBBBBBCCCCDDDDDDDEEEEEEEEEFFFFF

Then entry B is deleted, so you get this:
AAAAAAAAAAAAAA CCCCDDDDDDDEEEEEEEEEFFFFF

Then entry G is added, but it's smaller than B, so it's written were B used to be:
AAAAAAAAAAAAAAGGGGG CCCCDDDDDDDEEEEEEEEEFFFFF

Then H & J are written. H can't fit in the hole, but J can, so you get:
AAAAAAAAAAAAAAGGGGGJJJJ CCCCDDDDDDDEEEEEEEEEFFFFFHHHHHH

You get the idea. Now when Windows is looking for a specific registry key, the keys aren't in order any more, so it takes longer to find the data...

I was wondering if Windows edits the registry the way my example above does, or if it always keeps the keys (i.e. data in the files) sorted properly?
 
cpjust,

The registry is basically a database, so in a way it does store data like you are describing.

Let's Take an access database for example.

You add 4 rows to the table - each row takes up 1 MB of drive space.

You delete 2 row and add 4 more making 6 rows total. Now you would think that the DB would now be 6MB in size. However it will be 8MB until you use the compact and repair utility which will then reduce the size back down to 6MB.

Now that is a crude example and now all database work the same way, however as far as I am aware that is how the registry works.


Greg Palmer
Freeware Utilities for Windows Administrators.
 
Thanks.
I used CCleaner & NTRegOpt, but didn't find any noticable difference in speed afterwards. :-(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top