[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130131190558.GJ7651@ghostprotocols.net>
Date: Thu, 31 Jan 2013 16:05:58 -0300
From: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
To: David Ahern <dsahern@...il.com>
Cc: Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org,
Frederic Weisbecker <fweisbec@...il.com>,
Jiri Olsa <jolsa@...hat.com>, Mike Galbraith <efault@....de>,
Namhyung Kim <namhyung@...il.com>,
Paul Mackerras <paulus@...ba.org>,
Peter Zijlstra <peterz@...radead.org>,
Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 02/25] perf top: Delete maps on exit
Em Thu, Jan 31, 2013 at 11:14:00AM -0700, David Ahern escreveu:
> On 1/31/13 10:25 AM, Arnaldo Carvalho de Melo wrote:
> >Removing one more memory leak found with valgrind.
> If you are spending time one memory consumption by perf-top one thing
Those are the low hanging fruits :-)
> to look at is handling of terminated threads. Currently, terminated
> threads are stuck onto the dead_threads list and only cleaned up when
> perf terminates (perf_session__delete_dead_threads).
We need to have a refcount to know how many hist_entry instances point
to threads, once that refcount hits zero, because all symbols for such
thread have been decayed to zero samples and thus will be deleted and
removed from its hists struct, then we can remove it from dead_threads
list and delete it for good.
Ditto for dsos, etc.
> Since the thread entries can still be referenced in hists perhaps a
> refcnt is needed that indicates when the threads can be deleted.
Yeah, wrote the above before reading this 8-)
> From there regular calls to perf_session__delete_dead_threads can be
> made. I needed to add a regular call to that function in my perf
> daemon to keep memory usage stable - but then I don't have lingering
> references.
>
> A lot of work yes but will be needed if there is to be an official
> libperf.so that apps can leverage.
Right, I just added this to the TODO list in the perf wiki at:
https://perf.wiki.kernel.org/index.php/Todo
Thanks,
- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists