You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "lancelly (via GitHub)" <gi...@apache.org> on 2023/07/26 03:33:44 UTC

[GitHub] [iotdb] lancelly opened a new pull request, #10687: Add syncronized on MemoryReservationFuture to avoid potential memory leak

lancelly opened a new pull request, #10687:
URL: https://github.com/apache/iotdb/pull/10687

   If we do not add syncronized on the future of MemoryPool.tryCancel(), it may lead to memory leak like this:
   When close method of SharedTsBlockQueue is invoked, it will update bufferRetainedSizeInBytes using the value returned by tryCancel because if the MemoryReservationFuture is not completed, it means that the size of TsBlock is added wrongly.(Memory used by that TsBlock is not registered in MemoryPool since reserving memory failed)
   <img width="760" alt="截屏2023-07-26 11 19 18" src="https://github.com/apache/iotdb/assets/108499334/c212b6d1-637b-445d-ac2a-2afacdb38826">
   However, it's possible that the MemoryReservationFuture is completed by MemoryPool.free concurrently and register the TsBlock in MemoryPool while tryCancel still returns the size of TsBlock, leading to remaining records in the MemoryReservationMap.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] JackieTien97 merged pull request #10687: Fix potential memory leak in MemoryPool

Posted by "JackieTien97 (via GitHub)" <gi...@apache.org>.
JackieTien97 merged PR #10687:
URL: https://github.com/apache/iotdb/pull/10687


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org