Description
When catalog.bin is corrupted or missing, Workspace::rebuild_catalog() iterates through all documents and calls load() to load the complete PersistedDocument (including DocumentTree + NavigationIndex + ReasoningIndex), solely to extract the DocCard.
For workspace mode (100+ documents), this means holding many complete documents in memory simultaneously.
Related Code
rust/src/storage/workspace.rs — rebuild_catalog() method
Suggested Fix
- Stream processing: Load documents one by one, extract the DocCard, and release the document.
- Alternatively, implement a lightweight DocCard extraction method on
PersistedDocument to avoid deserializing the full tree.
- Add memory usage monitoring logs.
Description
When
catalog.binis corrupted or missing,Workspace::rebuild_catalog()iterates through all documents and callsload()to load the completePersistedDocument(including DocumentTree + NavigationIndex + ReasoningIndex), solely to extract the DocCard.For workspace mode (100+ documents), this means holding many complete documents in memory simultaneously.
Related Code
rust/src/storage/workspace.rs—rebuild_catalog()methodSuggested Fix
PersistedDocumentto avoid deserializing the full tree.