Subject: Re: bug#43389: 28.0.50; Emacs memory leaks

From: Eli Zaretskii <[email-masked]>
Date: Fri, 18 Sep 2020 11:22:54 +0300

> Date: Thu, 17 Sep 2020 22:47:04 +0200
> From: Russell Adams <[email-masked]>
> 
> >From Emacs memory-usage package:
> 
> Garbage collection stats:
> ((conses 16 1912248 251798) (symbols 48 54872 19) (strings 32 327552 81803) (string-bytes 1 12344346) (vectors 16 158994) (vector-slots 8 2973919 339416) (floats 8 992 4604) (intervals 56 182607 7492) (buffers 1000 195))
> 
>  =>	29.2MB (+ 3.84MB dead) in conses
> 	2.51MB (+ 0.89kB dead) in symbols
> 	10.00MB (+ 2.50MB dead) in strings
> 	11.8MB in string-bytes
> 	2.43MB in vectors
> 	22.7MB (+ 2.59MB dead) in vector-slots
> 	7.75kB (+ 36.0kB dead) in floats
> 	9.75MB (+  410kB dead) in intervals
> 	 190kB in buffers
> 
> Total in lisp objects: 97.9MB (live 88.5MB, dead 9.36MB)
> 
> Buffer ralloc memory usage:
> 81 buffers
> 4.71MB total (1007kB in gaps)
> 
> ----------------------------------------------------------------------
> 
> And /proc/PID/smaps which is huge so I pastebinned it.
> 
> https://termbin.com/2sx5

Thanks.

> 56413d24a000-5642821c6000 rw-p 00000000 00:00 0                          [heap]
> Size:            5324272 kB
> KernelPageSize:        4 kB
> MMUPageSize:           4 kB
> Rss:             5245496 kB
> Pss:             5245496 kB
> Shared_Clean:          0 kB
> Shared_Dirty:          0 kB
> Private_Clean:         0 kB
> Private_Dirty:   5245496 kB
> Referenced:      5245496 kB
> Anonymous:       5245496 kB
> LazyFree:              0 kB
> AnonHugePages:         0 kB
> ShmemPmdMapped:        0 kB
> FilePmdMapped:        0 kB
> Shared_Hugetlb:        0 kB
> Private_Hugetlb:       0 kB
> Swap:                  0 kB
> SwapPss:               0 kB
> Locked:                0 kB
> THPeligible:            0
> VmFlags: rd wr mr mw me ac

So it seems to be our heap that takes most of the 5GB.

It might be interesting to see which operations/commands cause this
part to increase.