Debian Codegraph @

docs/api_reference/C/envset_memory_max.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_memory_max()</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="env.html" title="Chapter 5.  The DB_ENV Handle" />
11 <link rel="prev" href="envset_memory_init.html" title="DB_ENV-&gt;set_memory_init()" />
12 <link rel="next" href="envset_metadata_dir.html" title="DB_ENV-&gt;set_metadata_dir()" />
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_memory_max()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="envset_memory_init.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 5. 
26 The DB_ENV Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="envset_metadata_dir.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_memory_max"></a>DB_ENV-&gt;set_memory_max()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42
43 int
44 DB_ENV-&gt;set_memory_max(DB_ENV *dbenv, u_int32_t gbytes, u_int32_t bytes); </pre>
45 <p>
46 This method sets the maximum amount of memory to be used by shared
47 structures in the main environment region. These are the
48 structures used to coordinate access to the environment other than
49 mutexes and those in the page cache (memory pool). If the region
50 files are in memory mapped files, or if
51 <code class="literal">DB_PRIVATE</code> is specified, the memory specified by
52 this method is not allocated completely at startup. As memory is
53 needed, the shared region will be extended or, in the case of
54 <code class="literal">DB_PRIVATE</code>, more memory will be allocated using
55 the system malloc call. For memory mapped files, a mapped region
56 will be allocated to this size but the underlying file will only be
57 allocated sufficient memory to hold the initial allocation of
58 shared memory structures as set by
59 <a class="xref" href="envset_memory_init.html" title="DB_ENV-&gt;set_memory_init()">DB_ENV-&gt;set_memory_init()</a>.
60 </p>
61 <p>
62 If no memory maximum is specified then it is calculated from
63 defaults, initial settings or (deprecated) maximum settings of the
64 various shared structures. In the case of environments created
65 with <code class="literal">DB_PRIVATE</code>, no maximum need be set and the
66 shared structure allocation will grow as needed until the process
67 memory limit is exhausted.
68 </p>
69 <p>
70 The database environment's maximum memory may also be configured
71 using the environment's
72 <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
73 file. The syntax of the entry in that file is a single line with
74 the string "set_memory_max", one or more whitespace characters,
75 followed by the maximum to be allocated. Because the
76 <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
77 file is read when the database environment is opened, it will
78 silently overrule configuration done before that time.
79 </p>
80 <p>
81 The <code class="methodname">DB_ENV-&gt;set_memory_max()</code> method must be
82 called prior to opening the database environment.
83 </p>
84 <div class="sect2" lang="en" xml:lang="en">
85 <div class="titlepage">
86 <div>
87 <div>
88 <h3 class="title"><a id="idp52154416"></a>Parameters</h3>
89 </div>
90 </div>
91 </div>
92 <div class="sect3" lang="en" xml:lang="en">
93 <div class="titlepage">
94 <div>
95 <div>
96 <h4 class="title"><a id="idp52166808"></a>gbytes</h4>
97 </div>
98 </div>
99 </div>
100 <p>
101 The maximum memory is set to
102 <span class="bold"><strong>gbytes</strong></span> gigabytes plus
103 <span class="bold"><strong>bytes</strong></span>.
104 </p>
105 </div>
106 <div class="sect3" lang="en" xml:lang="en">
107 <div class="titlepage">
108 <div>
109 <div>
110 <h4 class="title"><a id="idp52131264"></a>bytes</h4>
111 </div>
112 </div>
113 </div>
114 <p>
115 The maximum memory is set to
116 <span class="bold"><strong>gbytes</strong></span> gigabytes plus
117 <span class="bold"><strong>bytes</strong></span>.
118 </p>
119 </div>
120 </div>
121 <div class="sect2" lang="en" xml:lang="en">
122 <div class="titlepage">
123 <div>
124 <div>
125 <h3 class="title"><a id="idp52167312"></a>Errors</h3>
126 </div>
127 </div>
128 </div>
129 <p>
130 The <code class="methodname">DB_ENV-&gt;set_memory_max()</code> <span>
131 <span>
132 method may fail and return one of the following non-zero errors:
133 </span>
134
135 </span>
136 </p>
137 <div class="sect3" lang="en" xml:lang="en">
138 <div class="titlepage">
139 <div>
140 <div>
141 <h4 class="title"><a id="idp52131600"></a>EINVAL</h4>
142 </div>
143 </div>
144 </div>
145 <p>
146 If the method was called after <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a>
147 was called; or if an invalid flag value or parameter was specified.
148 </p>
149 </div>
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="idp52181160"></a>Class</h3>
156 </div>
157 </div>
158 </div>
159 <p>
160 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>
161 </p>
162 </div>
163 <div class="sect2" lang="en" xml:lang="en">
164 <div class="titlepage">
165 <div>
166 <div>
167 <h3 class="title"><a id="idp52182496"></a>See Also</h3>
168 </div>
169 </div>
170 </div>
171 <p>
172 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>
173 </p>
174 </div>
175 </div>
176 <div class="navfooter">
177 <hr />
178 <table width="100%" summary="Navigation footer">
179 <tr>
180 <td width="40%" align="left"><a accesskey="p" href="envset_memory_init.html">Prev</a> </td>
181 <td width="20%" align="center">
182 <a accesskey="u" href="env.html">Up</a>
183 </td>
184 <td width="40%" align="right"> <a accesskey="n" href="envset_metadata_dir.html">Next</a></td>
185 </tr>
186 <tr>
187 <td width="40%" align="left" valign="top">DB_ENV-&gt;set_memory_init() </td>
188 <td width="20%" align="center">
189 <a accesskey="h" href="index.html">Home</a>
190 </td>
191 <td width="40%" align="right" valign="top"> DB_ENV-&gt;set_metadata_dir()</td>
192 </tr>
193 </table>
194 </div>
195 </body>
196 </html>