Why does ICONCACHE.DB keep growing?

N

Nightowl

Hi everyone

I noticed several days ago that the iconcache.db file in my user profile
had grown from around 7MB to more than 16MB. I put this down to the fact
that I'd been fooling around with lots of icons in connection with a
little program I was trying to write. So I deleted the file and let
Windows rebuild it.

It came back at about 6MB but two days later had grown to 10.5MB, even
though I hadn't as much as touched an icon :) This time I flushed the
cache in memory first (by changing icon size and then changing it back
again), then I deleted the .db file again. It reappeared at 1.5MB.

Two days later, it's nearly 10MB, and now (another day later) 12.5MB. I
don't have thousands of programs installed (only got a 40GB disk and
more than half of that is empty :) and have 32 icons on the desktop. A
friend with more than 80 icons on the desktop and twin 250GB disks
crammed with programs says his file stays at around 5.5MB.

Can anyone tell me why the file keeps growing like this when I'm not
adding any programs or icons to the system? Could the icon cache in
memory be somehow adding copies of itself to the file on disk instead of
replacing them?
 
U

Uncle Grumpy

Nightowl said:
Can anyone tell me why the file keeps growing like this when I'm not
adding any programs or icons to the system? Could the icon cache in
memory be somehow adding copies of itself to the file on disk instead of
replacing them?

Until you brought up the subject, it never occurred to me to check the
icon cache.

It still doesn't occur to me to check it.

Why would you be concerned about a file that takes up only a few
megabytes on your drive??

You've got nothing better to do?
 
N

Nightowl

Why? Because I'm interested; I like to know what's happening on my
computer and why. I like to learn as much as I can about how XP works
both for my own amusement and to be able to help others; that's why I
read this group.

Actually I can't think of anything much better to do than learning
something new; your mileage obviously differs. I've yet to see you, dear
Uncle Grumpy, make one helpful post. You seem to spend all your time
attacking posters for the way they ask a question or for daring to ask
it at all. Poor old thing, *you* obviously have nothing better to do :)
 
S

Stan

Can anyone tell me why the file keeps growing like this when I'm not
adding any programs or icons to the system? Could the icon cache in
memory be somehow adding copies of itself to the file on disk instead of
replacing them?

Some lite reading for you:

http://articles.techrepublic.com.com/5100-1035_11-5164407.html

You can also delete ICONCACHE.DB and windows will rebuild it. If it
had become bloated due to corruption then it will be rebuilt properly.

Regards,
Stan
 
N

Nightowl

Stan said:
Some lite reading for you:

http://articles.techrepublic.com.com/5100-1035_11-5164407.html

You can also delete ICONCACHE.DB and windows will rebuild it. If it
had become bloated due to corruption then it will be rebuilt properly.

Thanks, Stan. I had already read that article and others similar,
though, and at the mo have the value set to 2048. I've also deleted and
rebuilt the file several times, both with and without flushing the cache
in memory first.

For the sake of Uncle Grumpy: I'm just intrigued because if the file's
purpose is what I thought it was (to cache the desktop and program
icons) I don't understand why it's constantly growing when nothing is
being added to the computer. Last rebuilt 5 days ago and reappeared at
1.5MB, yesterday 12.5MB, this morning after reboot up to 14MB!
 
G

George

Nice comeback!!!


Nightowl said:
Why? Because I'm interested; I like to know what's happening on my
computer and why. I like to learn as much as I can about how XP works both
for my own amusement and to be able to help others; that's why I read this
group.

Actually I can't think of anything much better to do than learning
something new; your mileage obviously differs. I've yet to see you, dear
Uncle Grumpy, make one helpful post. You seem to spend all your time
attacking posters for the way they ask a question or for daring to ask it
at all. Poor old thing, *you* obviously have nothing better to do :)
 
S

Stan

I don't understand why it's constantly growing when nothing is
being added to the computer. Last rebuilt 5 days ago and reappeared at
1.5MB, yesterday 12.5MB, this morning after reboot up to 14MB!

That's also amazing to me. Mine is 1.5 meg in size and was last
modified 6 months ago. I deleted it for sake of this thread to see
what would happen and it came back at the same exact size it was
before getting deleted and yet to grow one bit.

FYI, I have 9 folders and 10 icons on my desktop. My taskbar has 8
icons on the right and 9 icons on the left. I have a desktop graphics
image background but no screensaver running and no desktop theme
selected.

I run XP Home-SP2.

Regards,
Stan
 
N

Nightowl

[Nightowl:]
That's also amazing to me. Mine is 1.5 meg in size and was last
modified 6 months ago. I deleted it for sake of this thread to see
what would happen and it came back at the same exact size it was
before getting deleted and yet to grow one bit.

Thanks for doing the experiment, Stan. As I mentioned, a friend also
says his remains a constant size, but while Googling for information I
came across someone mentioning that their file had grown to 129MB! I'm
wondering if for some reason when the cache in memory writes to the file
it's adding a copy instead of replacing what's already there. It does
seem I'm not the only one who's seen this behaviour but I can't find any
explanation online; hoping one of the experts here will be able to
enlighten me.
 
M

mhc

Nightowl said:
Thanks, Stan. I had already read that article and others similar,
though, and at the mo have the value set to 2048. I've also deleted and
rebuilt the file several times, both with and without flushing the cache
in memory first.

For the sake of Uncle Grumpy: I'm just intrigued because if the file's
purpose is what I thought it was (to cache the desktop and program
icons) I don't understand why it's constantly growing when nothing is
being added to the computer. Last rebuilt 5 days ago and reappeared at
1.5MB, yesterday 12.5MB, this morning after reboot up to 14MB!

Windows will cache EVERY icon it displays in Explorer...which means if
you display the \windows\system32 folder, you will add several MB to the
cache file because hundreds of .exe icons will be displayed next to the
file name. You may also have a large number of programs in your start
menu, every one of which has an icon which is cached.

Limiting the size of the icon cache can be important to those with RAM
issues because Windows loads the entire cache into memory.

You can limit the growth of the icon cache by using "small icons" and
not allowing files to have their own icon displayed. I went one step
further and created a default blank icon, then told Windows to use only
that icon when displaying files. My iconcache.db file is 268K and NEVER
changes size!
 
N

Nightowl

Thanks so much for the informative reply, mhc. Please see my comments
inline.

was >>(to cache the desktop and program icons) I don't understand why
it's >>constantly growing when nothing is being added to the computer.
Windows will cache EVERY icon it displays in Explorer...which means if
you display the \windows\system32 folder, you will add several MB to
the cache file because hundreds of .exe icons will be displayed next to
the file name. You may also have a large number of programs in your
start menu, every one of which has an icon which is cached.

Ah, this makes a lot of sense. . . I do have quite a few programs and
utilities on the start menu organised in folders and I have been looking
at .dll files in System32 quite often lately. I seem to have
misunderstood how the cache works: I thought it cached, for example,
*one* .exe icon and duplicated that however many times necessary for
display -- I didn't realise it would cache each and every instance of
it!

But does this mean it will keep on growing and growing forever as the
user views more files, or is there an upper limit beyond which it will
recreate itself and start again?
Limiting the size of the icon cache can be important to those with RAM
issues because Windows loads the entire cache into memory.

Perhaps I'm wrong again here, but I thought the memory cache range was
500 --4096 icons, and that anything not found there would have to be
searched for in the .db file on disk, thus causing the slow refresh
problems some people suffer?
You can limit the growth of the icon cache by using "small icons" and
not allowing files to have their own icon displayed. I went one step
further and created a default blank icon, then told Windows to use only
that icon when displaying files. My iconcache.db file is 268K and NEVER
changes size!

I do use small icons in my menus and detail view for all folders --
haven't gone as far as you, though ;-) I'm still confused however about
the growing thing; why doesn't your file change size as you view more
folders, which is what you seemed to be saying above?

Thanks again for your response; I really appreciate it.
 
M

mhc

Nightowl said:
Ah, this makes a lot of sense. . . I do have quite a few programs and
utilities on the start menu organised in folders and I have been looking
at .dll files in System32 quite often lately. I seem to have
misunderstood how the cache works: I thought it cached, for example,
*one* .exe icon and duplicated that however many times necessary for
display -- I didn't realise it would cache each and every instance of it!

But does this mean it will keep on growing and growing forever as the
user views more files, or is there an upper limit beyond which it will
recreate itself and start again?


I do use small icons in my menus and detail view for all folders --
haven't gone as far as you, though ;-) I'm still confused however about
the growing thing; why doesn't your file change size as you view more
folders, which is what you seemed to be saying above?

Thanks again for your response; I really appreciate it.

My cache file doesn't change size because I hacked the registry so that
Windows displays the same (blank) icon for EVERY file. It is not
something I recommend because it essentially forces you to abandon the
use of desktop icons, but I don't use desktop icons!

The default Windows action is: if a .exe file contains an icon, Windows
will cache and display that icon. Look closely the next time you display
the system32 folder, you'll find that most .exe files have different
icons. Here's a simple registry hack which will force Windows to cache
and display only one icon for .exe files:

Start>Run>Regedit

Find the key: HKEY_CLASSES_ROOT\exefile\DefaultIcon

Its default value will be "%1" (minus the quotes). Change it to the
following:

%SystemRoot%\System32\shell32.dll,-153

After you clear your icon cache, your .EXE files will now all display
with the same icon as .BAT files. Note that some of your desktop icons
will also change, but they can be permanently fixed by right-clicking
the affected icons and re-selecting the proper icon via the Properties
dialog box.

This small hack will probably halve the size of your icon cache.
 
N

Nightowl

mhc said:
My cache file doesn't change size because I hacked the registry so that
Windows displays the same (blank) icon for EVERY file. It is not
something I recommend because it essentially forces you to abandon the
use of desktop icons, but I don't use desktop icons!

Thanks, mhc, I really appreciate all the information. I find this stuff
fascinating, though I know most people just want the thing to work and
don't want to know what goes on inside the box :)

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top