Problem Description
In the C++ standalone implementation, the LSHIndex stores post signatures in an in-memory hash map (std::unordered_map bucket structures). Unlike the TypeScript Redis implementation which has a 30-day TTL, the C++ index grows indefinitely and has no mechanism to prune old posts.
Proposed Fix
Introduce a memory management policy to the C++ LSHIndex:
- Store a timestamp for each indexed post ID.
- Implement a background cleaner thread or periodic pruning method (
pruneOldPosts) that runs after a threshold number of inserts.
- Bounded-size sliding window (e.g. remove entries older than 30 days) to keep memory footprint constant.
Problem Description
In the C++ standalone implementation, the
LSHIndexstores post signatures in an in-memory hash map (std::unordered_mapbucket structures). Unlike the TypeScript Redis implementation which has a 30-day TTL, the C++ index grows indefinitely and has no mechanism to prune old posts.Proposed Fix
Introduce a memory management policy to the C++
LSHIndex:pruneOldPosts) that runs after a threshold number of inserts.