public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug malloc/31556] New: Malloc is not cgroup aware
@ 2024-03-25 18:44 Sean.Dukehart at ssa dot gov
  2024-03-25 18:53 ` [Bug malloc/31556] " Sean.Dukehart at ssa dot gov
  0 siblings, 1 reply; 2+ messages in thread
From: Sean.Dukehart at ssa dot gov @ 2024-03-25 18:44 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31556

            Bug ID: 31556
           Summary: Malloc is not cgroup aware
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: malloc
          Assignee: unassigned at sourceware dot org
          Reporter: Sean.Dukehart at ssa dot gov
  Target Milestone: ---

I'm not 100% sure that this is genuinely a bug or if it's by design. 

But my Java application running in a Kubernetes environment with calls out to
native code via JNI eventually runs out of native memory. Eventually, I came
across https://github.com/prestodb/presto/issues/8993 &
https://www.gnu.org/software/libc/manual/html_node/Memory-Allocation-Tunables.html#index-glibc_002emalloc_002earena_005fmax,
which indicates the default of glibc.malloc.arena_max is "The default value of
this tunable is 0, meaning that the limit on the number of arenas is determined
by the number of CPU cores online. For 32-bit systems the limit is twice the
number of cores online and on 64-bit systems, it is 8 times the number of cores
online."

Digging into the code:
*
https://github.com/bminor/glibc/blob/1ea051145612f199d8716ecdf78b084b00b5a727/malloc/arena.c#L834-L841
* https://github.com/bminor/glibc/blob/master/malloc/malloc.c#L1921
*
https://github.com/bminor/glibc/blob/dc1a77269c971652a8a5167ec366792eae052e65/sysdeps/unix/sysv/linux/getsysstats.c#L213-L222

it doesn't appear that the malloc arena logic is taking into consideration
cgroup CPU limits. 

I'm out of my league here, but was wondering if this was by design, or if there
was an alternative cgroup-aware version of malloc or approach that should be
used.

Thanks!

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug malloc/31556] Malloc is not cgroup aware
  2024-03-25 18:44 [Bug malloc/31556] New: Malloc is not cgroup aware Sean.Dukehart at ssa dot gov
@ 2024-03-25 18:53 ` Sean.Dukehart at ssa dot gov
  0 siblings, 0 replies; 2+ messages in thread
From: Sean.Dukehart at ssa dot gov @ 2024-03-25 18:53 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31556

Sean Dukehart <Sean.Dukehart at ssa dot gov> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Sean.Dukehart at ssa dot gov

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2024-03-25 18:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-25 18:44 [Bug malloc/31556] New: Malloc is not cgroup aware Sean.Dukehart at ssa dot gov
2024-03-25 18:53 ` [Bug malloc/31556] " Sean.Dukehart at ssa dot gov

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 read-only IMAP folder(s) and NNTP newsgroup(s).