Attachments are inflated on sync

Please find below a "brain-dump" of the information I have found on this forum about Joplin as well as what I have discovered over the years!

A JEX export is the same data as the "RAW" export but wrapped into a single TAR file. TAR files are not compressed. That is why you will often see files online that are filename.tar.gz, which means that the source files have been combined into a single TAR file and then GZipped to compress it.

A JEX or RAW export exports just the "live" notes and data. Note history and orphan resources / attachments are not included. The Resources folder in a JEX file is very likely to be smaller than the source folder on the system.

If you delete an attachment from a note and no other note has that attachment linked to it you have an "orphan" file. How long that file stays stored in Joplin depends on how long your note history is set for. If your history is set to 90 days it will take 90 days before that unused attachment is marked as being suitable for deletion. Then after that it should get deleted when Joplin next runs its routine to clear out files set for deletion.

There is a difference between memory (RAM) and storage (disk space):

RAM - The "gargantuan" memory footprint referred to is possibly due to Joplin being an an app developed using the Electron framework. Electron is known for being particularly resource heavy. I guess that Electron is used because it enables the app to be developed for several different platforms at the same time.

Storage - When a user is using End to End Encryption (E2EE) the notes and the files in the Resources folder are sent to the sync target encrypted. I have seen that an encrypted version of a file in the Resources folder will be almost twice the size of the source. You can see the size difference by looking in the Resources folder and comparing a file with its .crypted counterpart. However it appears that these are basically cache files and no longer needed after they are transferred. @laurent has stated that if Joplin is closed down they can be deleted.

Apparently, in the past there was a reason for keeping the .crypted files in place and not deleting them, but that reason is no longer all that valid. In fact there is an issue on GitHub to develop a method for Joplin to delete the .crypted files when it starts.

So if / when this is developed the joplin-desktop/resources folder will start cleaning itself of .crypted files automatically.

2 Likes