duongkame commented on PR #1126: URL: https://github.com/apache/ratis/pull/1126#issuecomment-2310707581
>We may have stored the same TermIndex value multiple times. Otherwise, we won't get 2.4m TermIndex objects in https://github.com/apache/ratis/pull/1126#issuecomment-2258899751 Let's just revert the change by this PR and reexamine the problem with TermIndex instances somewhere else. The change is made prematurely, without due diligence. For such memory, we must. 1. Identify the problem root, e.g. is there duplicated, and where is the local source of keeping that huge amount of TermIndex instances? Is there anything wrong with logic? It's suspecting because we're only cache TermIndex in the RaftLogCache, where TermIndex should be unique. This doesn't sound right not to understand the problem and create a *global* cache with the hope to fix it. As per my experience, a global static cache usually brings more problems than solving them. 2. Make a quick fix and verify if the change really fixes the original problem. Without doing the above 2 things, we will likely introduce a new problem without solving the original, just like we did. @szetszwo @jojochuang -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@ratis.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org