2
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
4
<!--See the file LICENSE for redistribution information.-->
7
<title>Berkeley DB: DbEnv.set_mp_mmapsize</title>
8
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
12
<a name="2"><!--meow--></a>
13
<table width="100%"><tr valign=top>
15
<h1>DbEnv.set_mp_mmapsize</h1>
18
<a href="../api_java/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
23
import com.sleepycat.db.*;
25
public void set_mp_mmapsize(long mmapsize)
29
<p>Files that are opened read-only in the pool (and that satisfy a few
30
other criteria) are, by default, mapped into the process address space
31
instead of being copied into the local cache. This can result in
32
better-than-usual performance because available virtual memory is
33
normally much larger than the local cache, and page faults are faster
34
than page copying on many systems. However, it can cause resource
35
starvation in the presence of limited virtual memory, and it can result
36
in immense process sizes in the presence of large databases.
37
<p>Set the maximum file size, in bytes, for a file to be mapped into the
38
process address space. If no value is specified, it defaults to 10MB.
39
<p>The DbEnv.set_mp_mmapsize method configures operations performed using the specified
40
<a href="../api_java/env_class.html">DbEnv</a> handle, not all operations performed on the underlying
42
<p>The DbEnv.set_mp_mmapsize interface may be called at any time during the life of
44
<p>The DbEnv.set_mp_mmapsize method throws an exception that encapsulates a non-zero error value on
46
<p>The database environment's maximum mapped file size may also be set using the environment's
47
<b>DB_CONFIG</b> file. The syntax of the entry in that file is a
48
single line with the string "set_mp_mmapsize", one or more whitespace characters,
49
and the size in bytes. Because the <b>DB_CONFIG</b> file is read when the database
50
environment is opened, it will silently overrule configuration done
53
<p>The DbEnv.set_mp_mmapsize method may fail and throw an exception encapsulating a non-zero error for the following conditions:
55
<p><dt>EINVAL<dd>An invalid flag value or parameter was specified.
56
<p>Called after <a href="../api_java/env_open.html">DbEnv.open</a> was called.
58
<p>The DbEnv.set_mp_mmapsize method may fail and throw an exception for errors specified for other Berkeley DB and C library or system methods.
59
If a catastrophic error has occurred, the DbEnv.set_mp_mmapsize method may fail and
60
throw a <a href="../api_java/runrec_class.html">DbRunRecoveryException</a>,
61
in which case all subsequent Berkeley DB calls will fail in the same way.
63
<a href="../api_java/env_class.html">DbEnv</a>, <a href="../api_java/mempfile_class.html">DbMpoolFile</a>
65
<a href="../api_java/memp_list.html">Memory Pools and Related Methods</a>
67
<table width="100%"><tr><td><br></td><td align=right>
68
<a href="../api_java/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
70
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>