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

Re: Excessive mmap [was Git server eats all memory]

From
Dmitry Potapov <dpotapov@gmail.com>
Date
Aug 17, 2010, 17:07 UTC
Message-ID
<AANLkTimDx1Vg6kUaHgap6+khTmJYsxdiSDB6cb88-fnN@mail.gmail.com>
In-Reply-To
<wes4oetv31i.fsf@kanis.fr>
Hi Ivan,
On Tue, Aug 17, 2010 at 02:26:01PM +0200, Ivan Kanis wrote:
Show 6 quoted lines
>
> I have ran the following command for my tests: vmstat -SM -n 60
>
> Here's the stat for one git clone, I see that 4237M of memory is
> consumed. That is roughly the size of the repository. This raises my
> first question: why is the memory not reclaimed, at the end of the run?

It is consumed by system cache to hold the last read data, and it will hold it as long as there is enough free memory. When there is not enough free memory, the system will free some old (long time unused) pages from the system cache. This allows the system to avoid re-reading same files when there is enough memory to keep them.

Show 5 quoted lines
>
> ls -lh objects/pack/*.pack
> 4.2G objects/pack/pack-55ad6d01f37427ca69e6267b0cd4e5257e57272c.pack
>
> Is it a sensible behavior to leave a 4G file lying around?

I am not sure I understand your question. This pack contains all data of your repository. So what did you expect to happen?

> Does it get erased when people are pushing changes in?

No, usually, push adds a new pack. However, when there are too many packs, the garbage collector will try to repack everything in one new pack. You can create an empty file with the same name but with .keep extension to preserve the specified pack from being repacked.

Dmitry
Previous: Ivan Kanis
Message 28 of 28 in “Git server eats all memory”
  1. Ivan KanisAug 4, 2010
  2. Matthieu MoyAug 4, 2010
  3. Ivan KanisAug 4, 2010
  4. Avery PennarunAug 4, 2010
  5. Ivan KanisAug 5, 2010
  6. Jared HanceAug 5, 2010
  7. Nguyen Thai Ngoc DuyAug 6, 2010
  8. Nguyen Thai Ngoc DuyAug 6, 2010
  9. Jakub NarebskiAug 6, 2010
  10. Ivan KanisAug 6, 2010
  11. Dmitry PotapovAug 7, 2010
  12. Excessive mmap [was Git server eats all memory]Ivan Kanis, Aug 9, 2010
  13. Dmitry PotapovAug 9, 2010
  14. Ivan KanisAug 9, 2010
  15. Avery PennarunAug 9, 2010
  16. Tomas CarneckyAug 9, 2010
  17. Avery PennarunAug 9, 2010
  18. Dmitry PotapovAug 9, 2010
  19. Ivan KanisAug 11, 2010
  20. Avery PennarunAug 11, 2010
  21. Duy NguyenJun 20, 2018
  22. Robin H. JohnsonAug 10, 2010
  23. Sverre RabbelierAug 10, 2010
  24. Sam VilainAug 11, 2010
  25. Ivan KanisAug 11, 2010
  26. Nguyen Thai Ngoc DuyAug 9, 2010
  27. Ivan KanisAug 9, 2010
  28. Dmitry PotapovAug 17, 2010

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.