From: Andrey Kuznetsov Date: Thu, 19 Jun 2014 13:59:31 +0000 (+0400) Subject: [RGW, memory leak] Memory leak in RGW GC (losing pointer during allocating Ceph-conte... X-Git-Tag: v0.84~167^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8e5c92139e3ac164fc3323b7cc790d979307c0f1;p=ceph.git [RGW, memory leak] Memory leak in RGW GC (losing pointer during allocating Ceph-context) has been fixed. Memory leaks detector report: ... ==117947== 11,725 (200 direct, 11,525 indirect) bytes in 25 blocks are definitely lost in loss record 82 of 82 ==117947== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==117947== by 0x687CC1: RGWGC::process(int, int) (in /usr/bin/radosgw) ==117947== by 0x6884D1: RGWGC::process() (in /usr/bin/radosgw) ==117947== by 0x68875C: RGWGC::GCWorker::entry() (in /usr/bin/radosgw) ==117947== by 0x55F890A: Thread::_entry_func(void*) (in /usr/lib64/librados.so.2.0.0) ==117947== by 0x34D46079D0: start_thread (in /lib64/libpthread-2.12.so) ==117947== by 0x34D42E8B6C: clone (in /lib64/libc-2.12.so) ... Signed-off-by: Andrey Kuznetsov --- diff --git a/src/rgw/rgw_gc.cc b/src/rgw/rgw_gc.cc index dab07f341abc9..a20042d49ebbf 100644 --- a/src/rgw/rgw_gc.cc +++ b/src/rgw/rgw_gc.cc @@ -154,7 +154,7 @@ int RGWGC::process(int index, int max_secs) string marker; bool truncated; - IoCtx *ctx = NULL; + IoCtx *ctx = new IoCtx; do { int max = 100; std::list entries; @@ -167,7 +167,6 @@ int RGWGC::process(int index, int max_secs) goto done; string last_pool; - ctx = new IoCtx; std::list::iterator iter; for (iter = entries.begin(); iter != entries.end(); ++iter) { bool remove_tag;