ulikunitz/xz

memory leak

elmarli17 opened this issue · 2 comments

There is a memory leak. When I decompressed all the kernel modules for analysis, the VmRSS occupancy increased to 150M

RSS is not a good measurement for memory leaks. Go uses the flag MADV_FREE of madvise to return memory to the operating system. Linux will only reduce the RSS if there is actual memory pressure.

If you are caring about the RSS you might want to use GODEBUG="madvdontneed=1".
Check the documentation for madvdontneed in https://golang.org/pkg/runtime/

While I agree that the memory consumption of the implementation is high, there is nothing in the design that would result in a permanent memory leak of that size. That doesn't exclude that there might be a memory leak, but I would need more evidence regarding it. You might want to use gctrace GODEBUG option or the pprof tool to prove there is a memory leak.

So unless there is more evidence I will not work on it, but I will leave the issue open.

Thank you for the reply. According to your prompt, the test results showed no memory leak。