public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Christian Hoff <christian_hoff@gmx.net>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	Carlos O'Donell <carlos@redhat.com>,
	Konstantin Kharlamov <hi-angel@yandex.ru>,
	libc-help@sourceware.org
Subject: Re: Excessive memory consumption when using malloc()
Date: Fri, 26 Nov 2021 19:10:32 +0100	[thread overview]
Message-ID: <3f88fb7c-672a-da09-89d7-240e9991369d@gmx.net> (raw)
In-Reply-To: <d8d5cd5c-afb8-b6aa-408b-60d5d55b4353@linaro.org>

Hello Adhemerval,

On 11/25/21 9:56 PM, Adhemerval Zanella wrote:
> What I think we might improve is to maybe add an heuristic to call
> malloc_trim once a certain level of fragmentation in the main_arena is found.
> The question is which metric and threshold to use.  The trimming does have
> a cost, however I think it worth to decrease fragmentation and memory utilization.

Yes, I think this is a very good idea. It is difficult for us to tell
our customers that our application consumes so much memory even while it
is not running any computations. Of course, we can call malloc_trim() as
a workaround, but even this is difficult as this is a Java application,
so calling system functions is not so straightforward. Any glibc
improvements in this area would be highly welcome.


Best regards,

    Christian


  reply	other threads:[~2021-11-26 18:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25 17:20 Christian Hoff
2021-11-25 17:46 ` Konstantin Kharlamov
2021-11-25 18:12   ` Konstantin Kharlamov
2021-11-25 18:21     ` Carlos O'Donell
2021-11-25 20:56       ` Adhemerval Zanella
2021-11-26 18:10         ` Christian Hoff [this message]
2021-11-29 17:06           ` Patrick McGehearty
2021-11-25 18:20 ` Carlos O'Donell
2021-11-26 17:58   ` Christian Hoff
2021-11-29 19:44     ` Christian Hoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3f88fb7c-672a-da09-89d7-240e9991369d@gmx.net \
    --to=christian_hoff@gmx.net \
    --cc=adhemerval.zanella@linaro.org \
    --cc=carlos@redhat.com \
    --cc=hi-angel@yandex.ru \
    --cc=libc-help@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).