From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EB9EE3854082; Wed, 14 Dec 2022 21:50:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EB9EE3854082 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1671054619; bh=ek/zpscCz895G6sQc0SzuTbi2c9xJKIKFUSTDpAVsyI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=v5QiTOfi8IJWNLlF+xWGeyK1Ti3L2UDRHC1v0WMvGgJxlP7qWyXlVptVNtpJdUtkv rTlzPd2EWrcHPwhLnOBAhcYqFj+XaxczvHOQRbNiU0Yq012sEn3f3cpNBgh8gfGFmk 4cV14K0yxownmyiUFGcdSCbTI2Gtlqs19Xo6sf3o= From: "dj at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug malloc/14581] memalign allocations are often not reused after free Date: Wed, 14 Dec 2022 21:50:18 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: malloc X-Bugzilla-Version: 2.15 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: dj at redhat dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dj at redhat dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D14581 --- Comment #22 from dj at redhat dot com --- (In reply to Szabolcs Nagy from comment #20) > example: 100 iterations where each iteration leaks 16+64 bytes, everything > else is freed, but every iteration seems to increase the heap by 3231744 > bytes at least. with GLIBC_TUNABLES=3Dglibc.malloc.mmap_threshold=3D60000= 0 there > is no issue (large allocations turn into mmap/munmap pairs). I did a bunch of testing with this example, but didn't see continued growth= .=20 Typically, after a few loops, malloc learned to use one of the large chunks= for the 16/64 and to reuse all the others. I tried with and without tcache and fastbins in case those made a difference. Note: this is *without* my memal= ign patch. --=20 You are receiving this mail because: You are on the CC list for the bug.=