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

Re: [PATCH] Add support for changing packed_git_window_size at process start time

From
Shawn O. Pearce <spearce@spearce.org>
Date
Dec 26, 2008, 21:36 UTC
Message-ID
<20081226213604.GA20356@spearce.org>
In-Reply-To
<1229927143.14882.17.camel@starfruit>
"R. Tyler Ballance" <tyler@slide.com> wrote:
> Ah, gotcha, sounds like a good idea. I went ahead and added the change
> and I'm still getting the memory issues. 
:-|
 
Show 5 quoted lines
> I'm not as familiar with using gdb(1), so I'm having trouble tracking
> down the issue in a limited session, I get loads of issues like the
> following when trying to step through an execution of `git log`
> 
> Is there a means in which I can cause a core dump on an ENOMEM error passed back from mmap(2)? That or a way to impose these limits on the gdb git-subprocess but not on the gdb process?

Look at xmmap in git's code. All of our mmap calls go through that function and try to release pack windows if we get an error back from mmap(), then it retries the mmap request. xmalloc likewise does the same thing for malloc requests; xcalloc for calloc, xstrdup for strdup. We have a number of these x variant functions to handle memory allocation.

You might be be able to put a setrlimit call into main() in git.c to
drop the rlimit for Git to a lower limit than it inherited from gdb,
allowing you to start gdb with a much higher ulimit so it doesn't
barf when trying to inspect the git child.
 
-- 
Shawn.
Previous: R. Tyler Ballance
Message 8 of 8 in “Dynamically adjusting packed_git_window_size”
  1. R. Tyler BallanceDec 21, 2008
  2. Add support for changing packed_git_window_size at process start timeR. Tyler Ballance, Dec 21, 2008
  3. Style changes per suggestions from Junio in #gitR. Tyler Ballance, Dec 21, 2008
  4. Matthieu MoyDec 21, 2008
  5. Shawn O. PearceDec 21, 2008
  6. Shawn O. PearceDec 21, 2008
  7. R. Tyler BallanceDec 22, 2008
  8. Shawn O. PearceDec 26, 2008

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.