Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Sep 2014 23:29:21 +0400
From:      Slawa Olhovchenkov <slw@zxy.spb.ru>
To:        John Baldwin <jhb@freebsd.org>
Cc:        src-committers@freebsd.org, Peter Wemm <peter@wemm.org>, Alan Cox <alc@rice.edu>, alc@freebsd.org, svn-src-all@freebsd.org, Dmitry Morozovsky <marck@rinet.ru>, Andriy Gapon <avg@freebsd.org>, Steven Hartland <killing@multiplay.co.uk>, "Matthew D. Fuller" <fullermd@over-yonder.net>, svn-src-head@freebsd.org, Nikolai Lifanov <lifanov@mail.lifanov.com>
Subject:   Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm
Message-ID:  <20140910192921.GB7129@zxy.spb.ru>
In-Reply-To: <1758851.BtHUmxkW3Q@ralph.baldwin.cx>
References:  <201408281950.s7SJo90I047213@svn.freebsd.org> <1540004.aItdQtGhVh@ralph.baldwin.cx> <20140910163058.GA7129@zxy.spb.ru> <1758851.BtHUmxkW3Q@ralph.baldwin.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 10, 2014 at 02:29:30PM -0400, John Baldwin wrote:

> > Application must change behaviour when reach limit (run GC, switch
> > algorithm and etc.).
> > But mmap of big data file for scaning and processing don't touch this
> > limit.
> > Must be mmap of some temoprary file touch this limit? I don't know.
> > Must be MAP_ANON touch this limit? I think yes.
> > How to make distinction of mmap data file for processing and mmap
> > temporary file for bypass this limit? I don't know.
> 
> Consider also mmap() of shm_open(SHM_ANON).

No, shm limited separatly. mmap of shm_open(SHM_ANON) don't need to adjust
this limit.

> > And again, most application don't handle correctly NULL of malloc().
> > I think this is depreciate of all.
> 
> This is true, but it seems Firefox might, and you could set RLIMIT_AS
> for Firefox in particular so it gets adequate feedback.  I do think if
> you can determine the "correct" value for RLIMIT_AS for Firefox that
> mmap(MAP_ANON) would fail and result in NULL from malloc().

I am do some time ago firefox limiting by ulimit -v, firefox just
crashing. Don't run GC or something else.

> > PS: question about jemalloc. How I can stop jemalloc to give back
> > memory to OS for some application?
> 
> You would have to hack pages_purge() in chunk_mmap.c to always return true and 
> not call madvise().

And got memory leak?
I am talk about change behaviour from periodic mmap and madvise memory
to only mmap when need and leave for future use when freed by
aplication. I think (may be wrong -- please correct) in some cases
mmap/madvise will be too often.




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