Please visit the new Mac-Forums Facebook page:
https://www.facebook.com/macforums1




Page 1 of 3 123 LastLast
Results 1 to 15 of 31
  1. #1
    MacInWin
    Guest
    Snapshots.db is huge
    Investigating why my CCC backups have become huge (over 12G daily, even on days I don't do much), I discovered a file at /private/var/db/systemstats/snapshots.db that is over 12G just by itself. I found at article at Apple that says this file is gathering daily system stats about energy usage and although it shares a similar name, it is not associated with the snapshots of Time Machine. According to this article the file first appeared in Mavericks, had a growth problem but it was allegedly fixed in Yosemite. However, I'm running Yosemite 10.10.3 and my snapshots.db is over 12GB.

    Does anybody have any idea how to stop this from happening?

    If it helps, the snapshot.db file was created October 16, 2014 and has apparently been growing ever since. It was last updated today, one minute ago, so it's still growing.

    EDIT: ALso, SQLite won't open the file. It reports the file is improperly formed.
    Last edited by MacInWin; 04-20-2015 at 10:09 AM.

  2. #2
    MacInWin
    Guest
    Ok, this seemed to work. I found it at Apple. Instead of the mkdir and mv commands, I just mv'd the file to an external drive. I didn't want it on my internal SSD at all. The "sudo reboot" isn't needed, either, just reboot normally. My MBP is now much faster than it was, the huge file is gone and my SSD recovered 12GB. The daemons have restarted, so I'll probably have to repeat this process in a while, but for now, it seems sorted. I can see the snapshots.db recreated and already at 721 KB after 10 minutes, so it's an ongoing problem. I'm still looking for a permanent solution.

    sudo launchctl stop com.apple.systemstatsd
    sudo launchctl stop com.apple.systemstats.periodic
    sudo launchctl stop com.apple.systemstats.analysis
    mkdir /Users/Shared/oldsysstats
    sudo mv /private/var/db/systemstats/* /Users/Shared/oldsysstats
    sudo reboot

  3. #3
    MacInWin
    Guest
    Ok, booted two hours ago. snapshots.db is now 11.8MB, so it's growing about 6 mb/hour, or 144 MB/day. Sounds like a weekly task to get rid of this junk.

    Anybody else seeing it? Is it just me?

  4. #4
    Snapshots.db is huge
    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Groves, Texas
    Posts
    4,781
    Your Mac's Specs
    21in. iMac 10.11 --- HP Linux Mint 18
    Rep Power
    21
    First I've heard of it. Just checked and mine is 639mb.
    Created 4/3/15
    Any priest or shaman must be presumed guilty until proved innocent.

  5. #5
    MacInWin
    Guest
    @cradom, it's supposed to self-limit to about that size, but has a bug in which it occasionally fails to do that and grows endlessly. I've found a bunch of complaints about it on the net, and Apple is supposed to be aware of the problem. I'm going to keep an eye on it, now that I know it's there. My whole system perked up when I whacked that huge file, so it's worth the effort. If you keep an eye on it, you'll see that in that directory .stats files appear every 10 minutes and the .db itself is updated and grows every 10 minutes as well. Mine is now back up to 15.5MB after 2.5 hours.

  6. #6
    MacInWin
    Guest
    Been doing some research and analysis. Here is a chart of my backups from 1/1/15 to yesterday. As you can see, it was hovering around 1GB until about the 7th of January, then started to grow linearly until yesterday. The spikes are from when I must have done something to update a major application or the OS. There were two days with no backup, which show as holes in the data. But clearly, the snapshots.db file started to run away in early January. I'm only posting this as a cautionary tale for anyone else who might want to look at that file every once in a while just to make sure it isn't running away on them.

    I did talk to Mike at Bombich and he is aware of the file and plans to exclude it from backups in the future. He sees no need for it in a system backup as it gets rebuilt from scratch within a few minutes of removal.

    Also, I noted that after I got rid of the db, Activity Monitor didn't have data on the Energy page to show battery history over the past 12 hours. As of right now, the green bar showing charge level is just over 2/3s over, reflecting that I killed the db and booted about 7 hours ago. So that db is where Activity Monitor gets that data.

    Moral of the story? Watch that file! I plan to check it daily until I see that it's under control, then may move to weekly. I may craft a script to run the stuff I need to stop the daemons, delete the file and reboot if I find I have to manage this manually.
    Attached Images Attached Images

  7. #7
    Snapshots.db is huge
    bobtomay's Avatar
    Member Since
    Dec 22, 2006
    Location
    Texas, where else?
    Posts
    26,572
    Your Mac's Specs
    15" MBP '06 2.33 C2D 4GB 10.7; 13" MBA '14 1.8 i7 8GB 10.11; 21" iMac '13 2.9 i5 8GB 10.11; 6S
    Rep Power
    37
    Just for info - Created 2/28/15 - it is 210 MB.
    I cannot be held responsible for the things that come out of my mouth.
    In the Windows world, most everything folks don't understand is called a virus.

  8. #8
    MacInWin
    Guest
    What is even more frustrating is that over the roughly 100 days the average size is close to 7 GB, which means my one-a-day Time Machine backups have something like 700 GB of that file! No wonder my TM drive is filling faster than I thought it should.

  9. #9
    MacInWin
    Guest
    Update: 26 hours after deleting the file it is now at 160MB, and the folder containing it is at 172MB (the number of .stats files apparently increases by 3 every 10 minutes. There are now 252 files in that folder, most of which are .stats files and 51KB each.

  10. #10
    Snapshots.db is huge
    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,853
    Your Mac's Specs
    Early 2015 13" rMBP
    Rep Power
    30
    454 MB here, modified 4 minutes ago, created the day after Yosemite was released. It's grown 0.3 MB in the last five minutes and all I did was remote into my Mac (I'm not at home with it right now).

    I'll take a more in depth look tomorrow.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  11. #11
    MacInWin
    Guest
    As I said earlier, it's apparently supposed to self-limit to about 600 MB, so growing up to that size is not inappropriate. Don't know why my copy took off. It could be related to the fact the db was somehow damaged, maybe it couldn't be vacuumed, but right now it's at 188.7 MB, with the folder sitting at 204MB. From watching it, every 10 minutes or so new data is created in new .stats files that add up to about 300KB, then a minute later the .db is updated and grows by .3MB. I'm assuming that the new files are being copied into the .db as records. However the .stats files aren't being erased. There are now 308 of them. Given that the .db is 188.7 and the folder is 204 MB, some of the files are being overwritten, other are being created new. Looking at the metadata, most of the files are created, then modified 10 minutes later and never again. I do have a few that were created when I forced the process to quit and it restarted yesterday that are being updated, but there are only 4 that got updated today, and the last one was over an hour ago. I haven't changed my open apps much, so I can't tie the .stats files to any apps. The test will come in two days, when I predict the .db will exceed 600mb. If it doesn't then stop growing, I'll kill it again and let it restart from zero.

    What in the world was Apple thinking?

  12. #12
    Snapshots.db is huge
    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,853
    Your Mac's Specs
    Early 2015 13" rMBP
    Rep Power
    30
    I've set up a cron task to track the size of the snapshots.db file over the course of my day. It's growing pretty slowly here. I'll report back to see what kind of growth we have over the coming hours.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  13. #13
    MacInWin
    Guest
    My update is that with about 45 minutes to go to the 48 hour since restart point, the file is now 285MB, and the folder with all the other files is now at 475 files and 308MB.

    If, in fact, this data is needed to provide the battery status over the last 12 hours, why does it keep data beyond that? I may set up a daily cron job to get rid of this crap. I frankly don't care about how the battery was over the past 12 hours, or 2 days or month!

  14. #14
    Snapshots.db is huge
    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Groves, Texas
    Posts
    4,781
    Your Mac's Specs
    21in. iMac 10.11 --- HP Linux Mint 18
    Rep Power
    21
    Mine is down to 332.5mb. If this thing is related to energy usage, I keep this thing on almost all the time except when to and from work.
    Any priest or shaman must be presumed guilty until proved innocent.

  15. #15
    MacInWin
    Guest
    @cradom, do you have a bunch of .stats files in that folder also? In my case I have over 400 of them, adding 3-5 every 10 minutes and none of them have been deleted in the 48 hours since I whacked the whole thing and it restarted.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Big or huge?
    By lrd in forum iPhone Hardware and Accessories
    Replies: 3
    Last Post: 02-02-2015, 06:12 AM
  2. Huge Problem
    By Garlik in forum macOS - Operating System
    Replies: 3
    Last Post: 02-12-2008, 01:23 PM
  3. a HUGE ??
    By MoAmyot in forum Apple Desktops
    Replies: 14
    Last Post: 10-08-2007, 03:02 PM
  4. Huge pagefile
    By ToddG in forum macOS - Operating System
    Replies: 4
    Last Post: 12-24-2006, 03:55 PM
  5. Look! Win 98 Setup Snapshots!LOL!!!
    By The mac 13 in forum Archival Forum
    Replies: 15
    Last Post: 12-04-2004, 09:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •