Does Joplin do any garbage collection with deleted resources?

Please check your note history settings:
Note History: Joplin

Maximum database size is far above what can be used effectively in a note app Implementation Limits For SQLite (Severeal terabytes of data in the SQLLite database).