This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 577ef510d8e branch-2.1: [fix](mow) fix potential mem leak for 
DeleteBitmap::AggCache #52596 (#52613)
577ef510d8e is described below

commit 577ef510d8e844dc02a8067f1bc103ee5310a360
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Jul 2 09:20:30 2025 +0800

    branch-2.1: [fix](mow) fix potential mem leak for DeleteBitmap::AggCache 
#52596 (#52613)
    
    Cherry-picked from #52596
    
    Co-authored-by: zhannngchen <[email protected]>
---
 be/src/olap/tablet_meta.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/be/src/olap/tablet_meta.h b/be/src/olap/tablet_meta.h
index ba7dbbaf20d..efc4558f7bb 100644
--- a/be/src/olap/tablet_meta.h
+++ b/be/src/olap/tablet_meta.h
@@ -536,6 +536,12 @@ public:
             std::call_once(once, [size_in_bytes] {
                 auto* tmp = new AggCachePolicy(size_in_bytes);
                 AggCache::s_repr.store(tmp, std::memory_order_release);
+
+                // release the sigleton instance at program exit
+                std::atexit([] {
+                    auto* ptr = AggCache::s_repr.exchange(nullptr, 
std::memory_order_acquire);
+                    delete ptr;
+                });
             });
 
             while (!s_repr.load(std::memory_order_acquire)) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to