buffer8848 / gperftools

Automatically exported from code.google.com/p/gperftools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Memory consumption of a multi-threaded process grows over time with tcmalloc()

GoogleCodeExporter opened this issue · comments

We have a process that consumes lots of RAM - between 4 and 6 gigabytes. The 
process has lots of threads that allocate chunks of memory of various sizes. 
When using tcmalloc(), we see that our process consumes more and more memory 
over time. 

We see this using VIRT metrics in 'top'. 
The grows rate is approximately 400Mb a day. 
This does not happen when using glibc's malloc(). I.e. with glibc's malloc 
the process's virtual memory space does not grow.

Is it normal? Will it stop growing? What can we do to debug this problem?

Thanks.
Alex.

Original issue reported on code.google.com by alexande...@gmail.com on 11 Oct 2009 at 1:47

Typically this is normal behavior: tcmalloc doesn't release memory back to the 
kernel
by default.  In general, this yields better performance.  Is the increase in 
virtual
memory causing problems?  That is, do you see actual performance degradation 
because
of it?

If you want to reduce the virtual memory, look into the TCMALLOC_RELEASE_RATE
environment variable, documented in doc/tcmalloc.html.  You can also use
MallocExtension::instance()->GetStats() to get more information about how 
tcmalloc is
accounting for the memory it's using; that may give some insights for reducing 
memory
as well.

Original comment by csilv...@gmail.com on 13 Oct 2009 at 9:34

  • Changed state: NotABug
  • Added labels: Priority-Medium, Type-Defect