Debian Codegraph @

docs/api_reference/C/envset_mp_mmapsize.html

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <title>DB_ENV-&gt;set_mp_mmapsize()</title>
7 <link rel="stylesheet" href="apiReference.css" type="text/css" />
8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9 <link rel="start" href="index.html" title="Berkeley DB C API Reference" />
10 <link rel="up" href="memp.html" title="Chapter 8.  The DB_MPOOLFILE Handle" />
11 <link rel="prev" href="mempset_mp_max_write.html" title="DB_ENV-&gt;set_mp_max_write()" />
12 <link rel="next" href="envset_mp_mtxcount.html" title="DB_ENV-&gt;set_mp_mtxcount()" />
13 </head>
14 <body>
15 <div xmlns="" class="navheader">
16 <div class="libver">
17 <p>Library Version 11.2.5.3</p>
18 </div>
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">DB_ENV-&gt;set_mp_mmapsize()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="mempset_mp_max_write.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 8. 
26 The DB_MPOOLFILE Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="envset_mp_mtxcount.html">Next</a></td>
29 </tr>
30 </table>
31 <hr />
32 </div>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
35 <div>
36 <div>
37 <h2 class="title" style="clear: both"><a id="envset_mp_mmapsize"></a>DB_ENV-&gt;set_mp_mmapsize()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42
43 int
44 DB_ENV-&gt;set_mp_mmapsize(DB_ENV *dbenv, size_t mp_mmapsize); </pre>
45 <p>
46 Files that are opened read-only in the cache (and that satisfy a few
47 other criteria) are, by default, mapped into the process address space
48 instead of being copied into the local cache. This can result in
49 better-than-usual performance because available virtual memory is
50 normally much larger than the local cache, and page faults are faster
51 than page copying on many systems. However, it can cause resource
52 starvation in the presence of limited virtual memory, and it can
53 result in immense process sizes in the presence of large databases.
54 </p>
55 <p>
56 The <code class="methodname">DB_ENV-&gt;set_mp_mmapsize()</code> method sets the maximum file size, in
57 bytes, for a file to be mapped into the process address space. If no
58 value is specified, it defaults to 10MB.
59 </p>
60 <p>
61 The database environment's maximum mapped file size may also be
62 configured using the environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file. The syntax of
63 the entry in that file is a single line with the string
64 "set_mp_mmapsize", one or more whitespace characters, and the size
65 in bytes. Because the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is read when the database
66 environment is opened, it will silently overrule configuration
67 done before that time.
68 </p>
69 <p>
70 The <code class="methodname">DB_ENV-&gt;set_mp_mmapsize()</code> method configures a database
71 environment, not only operations performed using the specified
72 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a> handle.
73 </p>
74 <p>
75 The <code class="methodname">DB_ENV-&gt;set_mp_mmapsize()</code> method may be called at any time during
76 the life of the application.
77 </p>
78 <p>
79 The <code class="methodname">DB_ENV-&gt;set_mp_mmapsize()</code> <span>
80 <span>
81 method returns a non-zero error value on failure and 0 on success.
82 </span>
83
84 </span>
85 </p>
86 <div class="sect2" lang="en" xml:lang="en">
87 <div class="titlepage">
88 <div>
89 <div>
90 <h3 class="title"><a id="idp53382104"></a>Parameters</h3>
91 </div>
92 </div>
93 </div>
94 <div class="sect3" lang="en" xml:lang="en">
95 <div class="titlepage">
96 <div>
97 <div>
98 <h4 class="title"><a id="idp53382520"></a>mp_mmapsize</h4>
99 </div>
100 </div>
101 </div>
102 <p>
103 The <span class="bold"><strong>mp_mmapsize</strong></span> parameter is the
104 maximum file size, in bytes, for a file to be mapped into the process
105 address space.
106 </p>
107 </div>
108 </div>
109 <div class="sect2" lang="en" xml:lang="en">
110 <div class="titlepage">
111 <div>
112 <div>
113 <h3 class="title"><a id="idp53375720"></a>Errors</h3>
114 </div>
115 </div>
116 </div>
117 <p>
118 The <code class="methodname">DB_ENV-&gt;set_mp_mmapsize()</code> <span>
119 <span>
120 method may fail and return one of the following non-zero errors:
121 </span>
122
123 </span>
124 </p>
125 <div class="sect3" lang="en" xml:lang="en">
126 <div class="titlepage">
127 <div>
128 <div>
129 <h4 class="title"><a id="idp53390888"></a>EINVAL</h4>
130 </div>
131 </div>
132 </div>
133 <p>
134 An invalid flag value or parameter was specified.
135 </p>
136 </div>
137 </div>
138 <div class="sect2" lang="en" xml:lang="en">
139 <div class="titlepage">
140 <div>
141 <div>
142 <h3 class="title"><a id="idp53389808"></a>Class</h3>
143 </div>
144 </div>
145 </div>
146 <p>
147 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>,
148 <a class="link" href="memp.html" title="Chapter 8.  The DB_MPOOLFILE Handle">DB_MPOOLFILE</a>
149 </p>
150 </div>
151 <div class="sect2" lang="en" xml:lang="en">
152 <div class="titlepage">
153 <div>
154 <div>
155 <h3 class="title"><a id="idp53382584"></a>See Also</h3>
156 </div>
157 </div>
158 </div>
159 <p>
160 <a class="xref" href="memp.html#memplist" title="Memory Pools and Related Methods">Memory Pools and Related Methods</a>
161 </p>
162 </div>
163 </div>
164 <div class="navfooter">
165 <hr />
166 <table width="100%" summary="Navigation footer">
167 <tr>
168 <td width="40%" align="left"><a accesskey="p" href="mempset_mp_max_write.html">Prev</a> </td>
169 <td width="20%" align="center">
170 <a accesskey="u" href="memp.html">Up</a>
171 </td>
172 <td width="40%" align="right"> <a accesskey="n" href="envset_mp_mtxcount.html">Next</a></td>
173 </tr>
174 <tr>
175 <td width="40%" align="left" valign="top">DB_ENV-&gt;set_mp_max_write() </td>
176 <td width="20%" align="center">
177 <a accesskey="h" href="index.html">Home</a>
178 </td>
179 <td width="40%" align="right" valign="top"> DB_ENV-&gt;set_mp_mtxcount()</td>
180 </tr>
181 </table>
182 </div>
183 </body>
184 </html>