git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFD PATCH 0/3] Free all the memory!

From
David Turner <dturner@twopensource.com>
Date
May 17, 2016, 05:46 UTC
Message-ID
<1463464006.24478.71.camel@twopensource.com>
In-Reply-To
<20160517032247.25092-1-sbeller@google.com>
On Mon, 2016-05-16 at 20:22 -0700, Stefan Beller wrote:
Show 5 quoted lines
> When using automated tools to find memory leaks, it is hard to
> distinguish
> between actual leaks and intentional non-cleanups at the end of the
> program,
> such that the actual leaks hide in the noise.

valgrind on git rev-parse HEAD shows: ==21785== definitely lost: 153 bytes in 2 blocks ==21785== indirectly lost: 0 bytes in 0 blocks ==217 85== possibly lost: 0 bytes in 0 blocks ==21785== still reachable: 58,635 bytes in 570 blocks ==21785== suppressed: 0 bytes in 0 blocks

AFAIK, nothing in the "definitely lost" category is fixed by your rev-parse patch. 
I don't think we care that much about "still reachable" memory -- I only care about lost memory.  I could imagine, I guess, something that happens to save a pointer to a bunch of memory that should be freed, but I don't think that's the common case.
Unless, I guess, you're planning on making a library out of git.  Then it would be worth doing much more cleanup.
Previous: Ævar Arnfjörð BjarmasonNext: Matthieu Moy
Message 14 of 15 in “Free all the memory!”
  1. 0/3 Free all the memory!Stefan Beller, May 17, 2016
  2. 1/3 mv: free memory at the end if desiredStefan Beller, May 17, 2016
  3. Torsten BögershausenMay 17, 2016
  4. 2/3 pack-redundant: free all memoryStefan Beller, May 17, 2016
  5. Eric SunshineMay 17, 2016
  6. 3/3 rev-parse: free all memoryStefan Beller, May 17, 2016
  7. Eric SunshineMay 17, 2016
  8. Eric WongMay 17, 2016
  9. Stefan BellerMay 17, 2016
  10. Junio C HamanoMay 17, 2016
  11. Stefan BellerMay 17, 2016
  12. Eric WongMay 18, 2016
  13. Ævar Arnfjörð BjarmasonMay 18, 2016
  14. David TurnerMay 17, 2016
  15. Matthieu MoyMay 17, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.