Skip to content

Bug: C++ LSHIndex grows indefinitely without memory pruning / TTL policy #2

Description

@harsharajkumar-273

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:

  1. Store a timestamp for each indexed post ID.
  2. Implement a background cleaner thread or periodic pruning method (pruneOldPosts) that runs after a threshold number of inserts.
  3. Bounded-size sliding window (e.g. remove entries older than 30 days) to keep memory footprint constant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions