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

Re: arbitrary memory allocation

From
Jeff King <peff@peff.net>
Date
Dec 2, 2015, 06:09 UTC
Message-ID
<20151202060942.GA8212@sigill.intra.peff.net>
In-Reply-To
<1a012fc79a55cae8b948b28d1259be0c.squirrel@sdfeu.org>
On Thu, Nov 26, 2015 at 05:06:35AM +0100, ytrezq@sdf-eu.org wrote:
> First, something I still don t understand, should I always ulimit ram
> usage for security purposes when I m manage a public server?

You didn't define "public" here. For serving fetches, the memory tends to be fairly bounded and dependent on the repo you're serving. For accepting pushes, it's trivial to convince the server to allocate a lot of memory (you can send an unbounded set of ref updates, or you can simply send a 50GB object that compresses down to a tiny size).

Git does not have any internal memory controls, and will generally rely on malloc() to tell it when it is not being reasonable. I'd suggest using OS-level memory controls like cgroups if you're hosting something public.

-Peff
Previous: Stefan Beller
Message 4 of 4 in “arbitrary memory allocation”
  1. ytrezq@sdf-eu.orgNov 26, 2015
  2. Junio C HamanoDec 1, 2015
  3. Stefan BellerDec 1, 2015
  4. Jeff KingDec 2, 2015

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.