[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: Increasing memory usage on successive LMDB reads
- To: Rohit Girdhar <rohit.iiith@gmail.com>, openldap-technical@openldap.org
- Subject: Re: Increasing memory usage on successive LMDB reads
- From: Howard Chu <hyc@symas.com>
- Date: Fri, 31 Jul 2015 15:02:44 +0100
- In-reply-to: <CANh2OKqphu-GKku1WpMCWnEjq=mKS4tDiu+nZP-bJVZEPqkBRg@mail.gmail.com>
- References: <CANh2OKqphu-GKku1WpMCWnEjq=mKS4tDiu+nZP-bJVZEPqkBRg@mail.gmail.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0 SeaMonkey/2.37a1
Rohit Girdhar wrote:
Hi
I'm using LMDB (original C interface) to store and read some data. However, I
notice that my resident memory usage (RES in `htop`) keeps rising with each
call to mdb_get with unique keys. It does not change if I do a repeated call
to mdb_get with a key I've used before.
It looks like mdb_get is caching the reads,
LMDB does no caching of its own. Read the docs. Learn how mmap works.
but I want to make sure what
effect it is really having on my system. Is there some way to limit the amount
of memory lmdb can use for this? Or is it something strange and should not be
happening?
There's nothing strange going on. LMDB's memory use is entirely constrained by
how much demand for memory other processes on the system are imposing, i.e.
system memory pressure. If there is no pressure, LMDB will use all available
RAM (or up to the configured mapsize, whichever is less). If there is memory
pressure, LMDB will use less. Memory used by LMDB grows and shrinks
dynamically and automatically with the system load.
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/