Why is my hard drive fragmenting?
Recently my hard drive has been severely fragmenting. After an hour of normal web surfing the CPU slows to a stop. After each hour I have almost 5000 fragmentations. My disk defragmenter shows Firefox cach entries to be the culprit with multiple pages of 2 and 3 fragmentation blocks. There is a ton of this reported on the internet and appears to be a glitch in the way Firefox writes to the drive. I am using Windows 7 (because I want to;-) Thanks!
Alle svar (10)
Firefox does not "write to the drive" Windows is responsible for that function. When you browse the net, a lot of data is being updated and cached. Fragmentation is normal, and should not be considered as a problem, especially in the areas where the cached data is stored. I would suggest you to get either a better defrag software that does not rise flags because of poor analysis of files, or just do the defragmentation once a month, and worry rather about registry and page file fragmentation. Do also some research on free space consolidation that most likely your defrag software is not aware about...
Thanks for the reply. I'm sure you are correct that Firefox does not write to the drive. The defrag program may or may not show an accurate picture of what is going on but my inability to click on a hypertext link or right click without waiting 10-20 seconds for a response is not due to "poor analysis." After running defrag with a 5000 count, the computer runs without any problems...for about an hour or so and then I have to defrag...again. There is MUCH discussion of this problem on the internet. My defrag analysis shows that Firefox cache entries are the problem.
Hi TooOldforThis
TL:DR Not sure it is a global problem. If you have the time and need help with YOUR problem will try to see if we can help you.
I am not saying Firefox is guilty.
I would however consider that it is possible Firefox is contributing to this problem in one or two edge cases. I know especially where History is cleared on closedown Firefox may have problems (Or may have had problems in recent versions) and generates unexpectedly large files. That could involve the database places.sqlite and related files or cache files.
There have also been reports of some people finding issues when attempting to clear the cache in Firefox.
Although I have made this comment I do worry that this could lead us nowhere. I could be just adding to the confusion and conflating unrelated factors where there is no true cause and effect. We must remember that with Firefox having say 1/2 a Billion users there will be correlations for anything if you look.
Regardless of all I have said above here, if you have problems with using Firefox and it is going slowly it is something we are interested in and should try to help you with. Unfortunately troubleshooting and tracking down such problems can be far from straight forward.
You mentionThere is a ton of this reported on the internet and appears to be a glitch in the way Firefox writes to the drive.
- Have you got links to support that theory. Preferably to authoritative & technical type sites ?
I did not particularly see anything standing out on our own bug tracking. Some I did make a note of were
- 2011 Bug 692343 - Add telemetry to discover the level of fragmentation for profile files on Windows
That did not seem to get anywhere but maybe we do have some other telemetry data - 2014 Bug 965936 - (defrag) [meta] Virtual address space fragmentation
It is a tracking of meta bug. Also its about the virtual address space though not hdd - 2014 Bug 1101179 - Huge graphics memory fragmentation on Windows
Finally concluding with these are so rare now that it's not worth bothering at all.
You seem to be using 64bit Firefox on Windows, is that correct ?
Having said we will try to help you I am not too sure how to.
My first thoughts would be it will be worth collecting information so that a bug may be filed. You say
After an hour of normal web surfing the CPU slows to a stop. After each hour I have almost 5000 fragmentations.
Could you try an hour of surfing on one site only and with Firefox set up as follows
- In Window safe mode with Networking
- Using a new Firefox profile
- In Firefox's Safe Mode
- With all plugins disabled
If you see a problem in that configuration, then try again after a clean reinstall & we can then probably file a bug and get developers to look at it.
Additionally it would be worth comparing 32bit Firefox.
I could provide further information but you probably have already been put off by the thought of trying to do this, sort of testing.
John, These two posts are the most interesting. Especially the second regarding the sizes of file allocation.
http://www.dslreports.com/forum/r30520423-Firefox-Disk-Fragmentation-fr om-FF-Profiles-Cache
https://groups.google.com/forum/#!topic/mozilla.dev.platform/4KuiEQqMU kc
I'll get started on the rest of your suggestions.
That second article refers to Virtual Memory fragmentation, which I believe is not related to your issue. Virtual Memory is the Windows mechanism for making different applications think they have a huge amount of RAM by swapping less used bits and pieces out of physical memory to disk. I think Windows preallocates the part of disk used for this and it is a black box as far as disk defragmentation is concerned.
With the amount of RAM on current workstations and desktop system, it is a "I believe" a good idea to limit the size of the "disk cache" to eg. 1GB and create a RAM drive to store the cache in RAM rather than on disk. It dramatically improves the experience of browsing the net on a traditional spinning storage , even when a SSD drive is used - it is not only "faster", but might increase the life of the SSD, and finally solves also the fragmentation issue. afaik you can increase the RAM amount that FireFox is using for data caching, and disabling "disk" cache completely - this would be another way of solving file frag issues and increasing the performance. another option is to change the path where cached data is stored to an alternate location, a different partition other than the OS, which might not help much solving the fragmentation issue, but most likely it will improve the performance, and will not increase the fragmentation on the system drive, where higher performance is desired. as the last word that I would like to add to this topic, is a short comment on OP's last sentence: " I am using Windows 7 (because I want to;-) " I am not sure how to interpret this - since "you want so", you will have to live with file fragmentation due to the filesystem design, and choices that the Windows OS makes when performing write operations, unless you disable the disk cache completely... btw, I am too old to say: "because I want so".
Lets not lose sight of the fact TooOldforThis can only browse for an hour at a time. So something is badly wrong.
If this becomes a discussion of file systems and defrag tools we would probably be better taking it to the off topic section. On the other hand we do have a genuine problem here to try to solve.
We do have some very basic advice
- Firefox uses too much memory or CPU resources - How to fix
- Firefox uses too much memory or CPU resources - How to fix
init is bringing up the subject of current amounts of RAM and SSDs and page files
Now right now I am thinking what if TooOldforThis has a low spec. older machine with not much spare RAM and no much free hdd space. (It can not be too old it is 64 bit) Our Articles do not mention page files or HDD capacity and free space. Now if I think back a bit it was possibly sometimes suggested on Windows as good practice to have
- a large page file of up to 1.5 0r 2x the size of RAM.
Lets face it the page file would be likely to be used . - a large minimum size for the page file.
To reduce the possibility that the page file itself fragments if it were of variable size. (Also page file fragments in NTFS are unmoveable still I believe) - leave about 20-25% free space on the HDD
I don't now normally need to consider any of that on modern machines.
So why did I bring it up ? Well just a thought but is Firefox to blame here or may it just be the resources available on the machine in use ?
about:cache Can be used to throw up some details of Firefox cache usage. It may be helpful to glance at that. Before and during a browsing session. For all I know you TooOldforThis may be seeing multi GB skyrocketing cache use . If that is the case then maybe it is a problem with Firefox.
OK...so far:
-Confirm 64 bit OS -1/2 hour of surfing without changes = 753 fragments (Auslogic) -Windows Safe/New Profile/Firefox Safe w/Plugins Disabled = 592 fragments
--No appreciable difference
FYI: I am running my back up desktop with Windows 7. My primary laptop is frozen solid after upgrading my Windows 8 to Windows 10. The independent technician stated that I will have to purchase a Windows 8 restore disk form the Asus manufacturer. This may or may not be possible. As a result I have little option than to figure this out or go back to the Microsoft browser.
Quick reply using a phone.
Windows 8 Asus How can you go back to a Windows browser if the Windows OS is frozen solid and needing repair?
Off topic - I suggest trying Windows fora. I do have a vague recollection OEMs have an obligation to provide such discs . Also check if any generic disk would suffice. If all else fails consider using the defunct machine with Linux. That may well even be able to recover or use existing documents etc.
Windows 7 desktop
Still only working for an hour's browsing ? What's the cache looking like ? How's that machine for free space on the hdd as both total and % ?
How is it for RAM, total fitted and amount free. Id Windows is using thé page file browsing with Firefox It may well be slow.
Been surfing for 1.5 hours... 1853 frags...starting to slow down to unworkable.
RAM Total: 7893 Cached: 3553 Available: 4064 Free: 704 Physical Memory: 48%