Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Mar 2006 22:13:28 +0100
From:      des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=)
To:        Julian Elischer <julian@elischer.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org, Peter Wemm <peter@FreeBSD.org>
Subject:   Re: cvs commit: src/lib/libc/sys mmap.2
Message-ID:  <86k6ajpmvb.fsf@xps.des.no>
In-Reply-To: <442444C4.8020404@elischer.org> (Julian Elischer's message of "Fri, 24 Mar 2006 11:13:08 -0800")
References:  <200603232337.k2NNb6tH020675@repoman.freebsd.org> <86irq45etp.fsf@xps.des.no> <442444C4.8020404@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--=-=-=
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Julian Elischer <julian@elischer.org> writes:
> Dag-Erling Sm=F8rgrav wrote:
> > Are you saying that mmap() is not constrained by maxdsiz?
> that seems to be the case from my experience.

That's bad.  Our new malloc() uses mmap() to allocate arenas, which
means that dsiz no longer has any effect.  I've just confirmed this:

# phkmalloc on 5.4 / i386
% ulimit -d
524288
% ./allocate
511

# jemalloc on 7.0 / i386
% ulimit -d
524288
% ./allocate
697

# jemalloc on 7.0 / amd64
% ulimit -d
524288
% ./allocate
1844^C

Note the discrepancy on 7.0 / i386 - it does stop, but only after
exceeding dsiz by about 50%.  On amd64, it'll happily keep going until
it hits vsiz, which is unlimited by default.

DES
--=20
Dag-Erling Sm=F8rgrav - des@des.no


--=-=-=
Content-Disposition: attachment; filename=allocate.c

#include <stdio.h>
#include <stdlib.h>

int
main(void)
{
	int i = 0;

	while (malloc(1048576) != NULL) {
		printf("\r%d", ++i);
		fflush(stdout);
	}
	printf("\n");
	exit(0);
}

--=-=-=--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86k6ajpmvb.fsf>