Notes "On My Mac" large NoteStore.sqlite-wal

Hi team


On my macOS mojave Notes app, i have "On My Mac" checked off, but see a large NoteStore.sqlite-wal file and media folder. Could these be deleted if all my notes are on iCloud?


It does not go down on closing notes app


Notes "On My Mac" are stored in…



MacBook Pro 15", macOS 10.12

Posted on Mar 15, 2020 4:14 PM

Reply
9 replies

Mar 15, 2020 5:49 PM in response to Barney-15E

Barney-15E wrote:

The -wal file is the Write Ahead Log. It should not grow like that. It may be that it isn't getting overwritten, but added to.
The .sqlite file is where your data is stored. The app accesses the WAL while active, but once it is quit, both the -wal and -shm are not accessed.

Backup all of them by making copies somewhere and delete the -wal and -shm files. Open Notes and see what happens.


Insightful post Barney-15E


I see the -shm files are tmpfs files acting as normal directories, except they are entirely stored in RAM...

Mar 15, 2020 5:03 PM in response to cdat003

The -wal file is the Write Ahead Log. It should not grow like that. It may be that it isn't getting overwritten, but added to.

The .sqlite file is where your data is stored. The app accesses the WAL while active, but once it is quit, both the -wal and -shm are not accessed.


Backup all of them by making copies somewhere and delete the -wal and -shm files. Open Notes and see what happens.

Mar 15, 2020 4:33 PM in response to cdat003

I have not dug into this topic however, I would be a little dubious of deleting this database.


some more round about this topic ref: https://discussions.apple.com/thread/8137847


Its not huge gain here—your 4.4GB of media

but if you have storage issues there may be safer places to retrieve 4.4GB




Provide a quick breakdown by folder in descending order of used GB , from the Terminal.app , copy & paste:

 sudo ** -gs /Users/YourUserNameHere/* | sort -k 1nr


(please note: your psswd will not echo, type it in anyway, to proceed Enter/Return key)

==================================================================




How to free up storage space on your Mac - Apple Support

https://support.apple.com/en-us/HT206996


User tip: "Other and What Can I Do About It ?"

https://discussions.apple.com/docs/DOC-5142


Try something likeOmniDiskSweeper for a GUI to get a good look at itemized file size and location:

OmniDiskSweeper http://www.omnigroup.com/more


Others for example—

Disk Inventory X: http://www.derlien.com/ (takes forever to load up.)

Grand Perspective: http://grandperspectiv.sourceforge.net/


Or alternatively from the Terminal.app, more detail copy and paste the command line:


File size, and finding missing GB— list the items in the home folder with the sizes, including invisible items.

sudo ** -h -d 1 ~/


File size, and finding missing GB —will list the items in root with the sizes, including invisible items.

sudo ** -h -d 1 /


.

Mar 18, 2020 6:52 PM in response to cdat003

Yes, but I don't know what that pattern is.

Databases store blocks of information in "pages." The -shm and -wal files index those pages. They should not grow larger than the database itself, and should be much smaller.


The information about them on the Sqlite3 documentation states that the index should be overwritten, but it isn't ever cleared. It appears that the page index isn't being overwritten, but added to. Perhaps it will work correctly now.

Mar 16, 2020 10:40 PM in response to leroydouglas

Thanks for those steps.


When I moved the 3 files(NoteStore.sqlite-wal, NoteStore.sqlite-shm and NoteStore.sqlite) and opened Notes, I saw all empty notes, although I don't have anything on the local mac. I also saw that the "On my Mac" preference was auto-selected. What is causing this behaviour?


Another question is about the sizes of these directories if I store everything on iCloud - are these local sync caches for that?


** -sh group.com.apple.notes/Previews/
1.0G	group.com.apple.notes/Previews/



** -sh group.com.apple.notes/Media/
4.4G	group.com.apple.notes/Media/




This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Notes "On My Mac" large NoteStore.sqlite-wal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.