From: abudovski@... Date: 2015-08-19T16:19:01+00:00 Subject: [ruby-core:70464] [Ruby trunk - Bug #11459] Ruby leaks several MB of memory every setup/eval/cleanup cycle. Issue #11459 has been updated by Alex Budovski. Here's another big leak: This stack leaks nearly 1MB (~780K). When is Init_heap supposed to be undone? ~~~ + 787080 ( 787080 - 0) 24 allocs BackTrace9BD000CB + 24 ( 24 - 0) BackTrace9BD000CB allocations ntdll!RtlpCallInterceptRoutine+40 (d:\blue\minkernel\ntos\rtl\heappriv.h, 3625) ntdll!RtlAllocateHeap+79836 (d:\blue\minkernel\ntos\rtl\heap.c, 1892) MSVCR120D!_heap_alloc_base+5D (f:\dd\vctools\crt\crtw32\heap\malloc.c, 58) MSVCR120D!_heap_alloc_dbg_impl+27B (f:\dd\vctools\crt\crtw32\misc\dbgheap.c, 431) MSVCR120D!_nh_malloc_dbg_impl+39 (f:\dd\vctools\crt\crtw32\misc\dbgheap.c, 239) MSVCR120D!_nh_malloc_dbg+49 (f:\dd\vctools\crt\crtw32\misc\dbgheap.c, 302) MSVCR120D!_malloc_dbg+39 (f:\dd\vctools\crt\crtw32\misc\dbgheap.c, 160) MSVCR120D!_aligned_offset_malloc_dbg+245 (f:\dd\vctools\crt\crtw32\misc\dbgheap.c, 2891) MSVCR120D!_aligned_malloc+2B (f:\dd\vctools\crt\crtw32\misc\dbgheap.c, 2622) rubyprov!aligned_malloc+1E (e:\dev\ruby\gc.c, 7393) rubyprov!heap_page_allocate+2C (e:\dev\ruby\gc.c, 1445) rubyprov!heap_page_create+36 (e:\dev\ruby\gc.c, 1531) rubyprov!heap_assign_page+18 (e:\dev\ruby\gc.c, 1553) rubyprov!heap_add_pages+61 (e:\dev\ruby\gc.c, 1567) rubyprov!Init_heap+5E (e:\dev\ruby\gc.c, 2187) rubyprov!ruby_setup+47 (e:\dev\ruby\eval.c, 57) ~~~ ---------------------------------------- Bug #11459: Ruby leaks several MB of memory every setup/eval/cleanup cycle. https://bugs.ruby-lang.org/issues/11459#change-53871 * Author: Alex Budovski * Status: Open * Priority: Normal * Assignee: * ruby -v: latest master * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- Even with a trivial eval "1" Ruby leaks about 2 MB or so after ruby_cleanup. I've attached the raw list of leaks as reported by the CRT (I took a snapshot before ruby_setup and again after ruby_cleanup). I've also attacked a few sample callstacks of the leaks (I picked 5 or so randomly). Isn't ruby_cleanup supposed to clean something up? ---Files-------------------------------- rubyleaks.txt (1.47 MB) ruby_leak_stacks.txt (8.4 KB) -- https://bugs.ruby-lang.org/