Debian Codegraph @

docs/api_reference/CXX/envset_cache_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>DbEnv::set_cache_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="memp.html" title="Chapter 9.  The DbMpoolFile Handle" />
11 <link rel="prev" href="memptrickle.html" title="DbEnv::memp_trickle()" />
12 <link rel="next" href="envset_cachesize.html" title="DbEnv::set_cachesize()" />
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">DbEnv::set_cache_max()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="memptrickle.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 9. 
26 The DbMpoolFile Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="envset_cachesize.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_cache_max"></a>DbEnv::set_cache_max()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::set_cache_max(u_int32_t gbytes, u_int32_t bytes); </pre>
45 <p>
46 Sets the maximum cache size in bytes. The specified size is
47 rounded to the nearest multiple of the cache region size, which is
48 the initial cache size divided by the number of regions specified
49 to the <a class="xref" href="envset_cachesize.html" title="DbEnv::set_cachesize()">DbEnv::set_cachesize()</a> method. If no value is
50 specified, it defaults to the initial cache
51 size.
52 </p>
53 <p>
54 The database environment's maximum cache size may also be
55 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
56 the entry in that file is a single line with the string
57 "set_cache_max", one or more whitespace characters, and the
58 maximum cache size in bytes, specified in two parts: the gigabytes
59 of cache and the additional bytes of cache. Because the
60 <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is read when the database environment is opened,
61 it will silently overrule configuration done before that time.
62 </p>
63 <p>
64 The <code class="methodname">DbEnv::set_cache_max()</code> method configures a database environment,
65 not only operations performed using the specified
66 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a> handle.
67 </p>
68 <p>
69 The <code class="methodname">DbEnv::set_cache_max()</code> method must be
70 called prior to opening the database environment.
71 </p>
72 <p>
73 The <code class="methodname">DbEnv::set_cache_max()</code> <span>
74
75 <span>
76 method either returns a non-zero error value or throws an
77 exception that encapsulates a non-zero error value on
78 failure, and returns 0 on success.
79 </span>
80 </span>
81 </p>
82 <div class="sect2" lang="en" xml:lang="en">
83 <div class="titlepage">
84 <div>
85 <div>
86 <h3 class="title"><a id="idp8784384"></a>Parameters</h3>
87 </div>
88 </div>
89 </div>
90 <div class="sect3" lang="en" xml:lang="en">
91 <div class="titlepage">
92 <div>
93 <div>
94 <h4 class="title"><a id="idp8783736"></a>gbytes</h4>
95 </div>
96 </div>
97 </div>
98 <p>
99 The <span class="bold"><strong>gbytes</strong></span> parameter specifies the number of
100 bytes which, when added to the <span class="bold"><strong>bytes</strong></span>
101 parameter, specifies the maximum size of the cache.
102 </p>
103 </div>
104 <div class="sect3" lang="en" xml:lang="en">
105 <div class="titlepage">
106 <div>
107 <div>
108 <h4 class="title"><a id="idp8763832"></a>bytes</h4>
109 </div>
110 </div>
111 </div>
112 <p>
113 The <span class="bold"><strong>bytes</strong></span> parameter specifies the number of
114 bytes which, when added to the <span class="bold"><strong>gbytes</strong></span>
115 parameter, specifies the maximum size of the cache.
116 </p>
117 </div>
118 </div>
119 <div class="sect2" lang="en" xml:lang="en">
120 <div class="titlepage">
121 <div>
122 <div>
123 <h3 class="title"><a id="idp8774672"></a>Errors</h3>
124 </div>
125 </div>
126 </div>
127 <p>
128 The <code class="methodname">DbEnv::set_cache_max()</code> <span>
129
130 <span>
131 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
132 exception, encapsulating one of the following non-zero errors, or return one
133 of the following non-zero errors:
134 </span>
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="idp8793848"></a>EINVAL</h4>
142 </div>
143 </div>
144 </div>
145 <p>
146 An invalid flag value or parameter was specified.
147 </p>
148 </div>
149 </div>
150 <div class="sect2" lang="en" xml:lang="en">
151 <div class="titlepage">
152 <div>
153 <div>
154 <h3 class="title"><a id="idp8791872"></a>Class</h3>
155 </div>
156 </div>
157 </div>
158 <p>
159 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>
160 </p>
161 </div>
162 <div class="sect2" lang="en" xml:lang="en">
163 <div class="titlepage">
164 <div>
165 <div>
166 <h3 class="title"><a id="idp8780048"></a>See Also</h3>
167 </div>
168 </div>
169 </div>
170 <p>
171 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>
172 </p>
173 </div>
174 </div>
175 <div class="navfooter">
176 <hr />
177 <table width="100%" summary="Navigation footer">
178 <tr>
179 <td width="40%" align="left"><a accesskey="p" href="memptrickle.html">Prev</a> </td>
180 <td width="20%" align="center">
181 <a accesskey="u" href="memp.html">Up</a>
182 </td>
183 <td width="40%" align="right"> <a accesskey="n" href="envset_cachesize.html">Next</a></td>
184 </tr>
185 <tr>
186 <td width="40%" align="left" valign="top">DbEnv::memp_trickle() </td>
187 <td width="20%" align="center">
188 <a accesskey="h" href="index.html">Home</a>
189 </td>
190 <td width="40%" align="right" valign="top"> DbEnv::set_cachesize()</td>
191 </tr>
192 </table>
193 </div>
194 </body>
195 </html>