git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Huge possible memory leak while cherry-picking.
@ 2013-08-09 12:13 Лежанкин Иван
  2013-08-09 20:39 ` Felipe Contreras
  0 siblings, 1 reply; 9+ messages in thread
From: Лежанкин Иван @ 2013-08-09 12:13 UTC (permalink / raw)
  To: git

Hi,

I have tried to cherry-pick a range of ~200 commits from one branch to
another. And you can't imagine how I was surprised when the git
process ate 8 Gb of RAM and died - before cherry-picking was complete.

I downloaded git sources from master and built it with gperftools
support (-ltcmalloc). After running `git cherry-pick <some hash>` with
a heap-leak checker enabled I got this:

> Have memory regions w/o callers: might report false leaks
> Leak check _main_ detected leaks of 42838782 bytes in 257986 objects

These objects are allocated at

> read-cache.c:1340: struct cache_entry *ce = xmalloc(cache_entry_size(len));

After looking in the code, I found a comment in the function `static
void remove_dir_entry(...)`:

/*
 * Release reference to the directory entry (and parents if 0).
 *
 * Note: we do not remove / free the entry because there's no
 * hash.[ch]::remove_hash and dir->next may point to other entries
 * that are still valid, so we must not free the memory.
 */

So, this objects are never freed - by design?
Is it a real issue, or do I just misunderstand something?

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-08-13 21:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-09 12:13 Huge possible memory leak while cherry-picking Лежанкин Иван
2013-08-09 20:39 ` Felipe Contreras
2013-08-12 10:04   ` Лежанкин Иван
2013-08-12 10:09     ` Felipe Contreras
2013-08-13 18:27       ` [PATCH] unpack-trees: plug a memory leak René Scharfe
2013-08-13 21:12         ` Junio C Hamano
2013-08-13 21:32           ` René Scharfe
2013-08-13 21:50             ` Junio C Hamano
2013-08-12 10:34     ` Huge possible memory leak while cherry-picking Felipe Contreras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).