| 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->get_memory_init()</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="envget_intermediate_dir_mode.html" title="DB_ENV->get_intermediate_dir_mode()" /> |
| 12 | <link rel="next" href="envget_memory_max.html" title="DB_ENV->get_memory_max()" /> |
| 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->get_memory_init()</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="envget_intermediate_dir_mode.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="envget_memory_max.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="envget_memory_init"></a>DB_ENV->get_memory_init()</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">#include <db.h> |
| 42 | |
| 43 | int |
| 44 | DB_ENV->get_memory_init(DB_ENV *dbenv, DB_MEM_CONFIG type, |
| 45 | u_int32_t *countp); </pre> |
| 46 | <p> |
| 47 | The <code class="methodname">DB_ENV->get_memory_init()</code> method returns |
| 48 | the number of objects to allocate and initialize when an |
| 49 | environment is created. The count is returned for a specific named |
| 50 | structure. The count for each structure is set using the |
| 51 | <a class="xref" href="envset_memory_init.html" title="DB_ENV->set_memory_init()">DB_ENV->set_memory_init()</a> |
| 52 | method. |
| 53 | </p> |
| 54 | <p> |
| 55 | The <code class="methodname">DB_ENV->get_memory_init()</code> method may be |
| 56 | called at any time during the life of the application. |
| 57 | </p> |
| 58 | <p> |
| 59 | The <code class="methodname">DB_ENV->get_memory_init()</code> <span> |
| 60 | <span> |
| 61 | method returns a non-zero error value on failure and 0 on success. |
| 62 | </span> |
| 63 | |
| 64 | </span> |
| 65 | |
| 66 | </p> |
| 67 | <div class="sect2" lang="en" xml:lang="en"> |
| 68 | <div class="titlepage"> |
| 69 | <div> |
| 70 | <div> |
| 71 | <h3 class="title"><a id="idp51533528"></a>Parameters</h3> |
| 72 | </div> |
| 73 | </div> |
| 74 | </div> |
| 75 | <div class="sect3" lang="en" xml:lang="en"> |
| 76 | <div class="titlepage"> |
| 77 | <div> |
| 78 | <div> |
| 79 | <h4 class="title"><a id="idp51532880"></a>type</h4> |
| 80 | </div> |
| 81 | </div> |
| 82 | </div> |
| 83 | <p> |
| 84 | The <span class="bold"><strong>struct</strong></span> parameter |
| 85 | identifies the structure for which you want |
| 86 | an object count returned. It must be one of the following |
| 87 | values: |
| 88 | </p> |
| 89 | <div class="itemizedlist"> |
| 90 | <ul type="disc"> |
| 91 | <li> |
| 92 | <p> |
| 93 | <code class="literal">DB_MEM_LOCK</code> |
| 94 | </p> |
| 95 | <p> |
| 96 | Initialize locks. A thread uses this structure |
| 97 | to lock a page (or record for the QUEUE access |
| 98 | method) and hold it to the end of a transactions. |
| 99 | </p> |
| 100 | </li> |
| 101 | <li> |
| 102 | <p> |
| 103 | <code class="literal">DB_MEM_LOCKOBJECT</code> |
| 104 | </p> |
| 105 | <p> |
| 106 | Initialize lock objects. For each page (or record) which |
| 107 | is locked in the system, a lock object will be allocated. |
| 108 | </p> |
| 109 | </li> |
| 110 | <li> |
| 111 | <p> |
| 112 | <code class="literal">DB_MEM_LOCKER</code> |
| 113 | </p> |
| 114 | <p> |
| 115 | Initialize lockers. Each thread which is active in a |
| 116 | transactional environment will use a locker structure |
| 117 | either for each transaction which is active, or for each |
| 118 | non-transactional cursor that is active. |
| 119 | </p> |
| 120 | </li> |
| 121 | <li> |
| 122 | <p> |
| 123 | <code class="literal">DB_MEM_LOGID</code> |
| 124 | </p> |
| 125 | <p> |
| 126 | Initialize the log fileid structures. For each database handle |
| 127 | which is opened for writing in a transactional environment, |
| 128 | a log fileid structure is used. |
| 129 | </p> |
| 130 | </li> |
| 131 | <li> |
| 132 | <p> |
| 133 | <code class="literal">DB_MEM_TRANSACTION</code> |
| 134 | </p> |
| 135 | <p> |
| 136 | Initialize transaction structures. Each active |
| 137 | transaction uses a transaction structure until it |
| 138 | either commits or aborts. |
| 139 | </p> |
| 140 | </li> |
| 141 | <li> |
| 142 | <p> |
| 143 | <code class="literal">DB_MEM_THREAD</code> |
| 144 | </p> |
| 145 | <p> |
| 146 | Initialize thread identification structures. If thread |
| 147 | tracking is enabled then each active thread will use a |
| 148 | structure. Note that since a thread does not signal the |
| 149 | BDB library that it will no longer be making calls, unused |
| 150 | structures may accumulate until a cleanup is triggered either |
| 151 | using a high water mark or by running |
| 152 | <a class="xref" href="envfailchk.html" title="DB_ENV->failchk()">DB_ENV->failchk()</a>. |
| 153 | </p> |
| 154 | </li> |
| 155 | </ul> |
| 156 | </div> |
| 157 | </div> |
| 158 | <div class="sect3" lang="en" xml:lang="en"> |
| 159 | <div class="titlepage"> |
| 160 | <div> |
| 161 | <div> |
| 162 | <h4 class="title"><a id="idp51546696"></a>countp</h4> |
| 163 | </div> |
| 164 | </div> |
| 165 | </div> |
| 166 | <p> |
| 167 | The <span class="bold"><strong>countp</strong></span> parameter references |
| 168 | memory into which the object count for the specified |
| 169 | structure is copied. |
| 170 | </p> |
| 171 | </div> |
| 172 | </div> |
| 173 | <div class="sect2" lang="en" xml:lang="en"> |
| 174 | <div class="titlepage"> |
| 175 | <div> |
| 176 | <div> |
| 177 | <h3 class="title"><a id="idp51536880"></a>Class</h3> |
| 178 | </div> |
| 179 | </div> |
| 180 | </div> |
| 181 | <p> |
| 182 | <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a> |
| 183 | </p> |
| 184 | </div> |
| 185 | <div class="sect2" lang="en" xml:lang="en"> |
| 186 | <div class="titlepage"> |
| 187 | <div> |
| 188 | <div> |
| 189 | <h3 class="title"><a id="idp51548984"></a>See Also</h3> |
| 190 | </div> |
| 191 | </div> |
| 192 | </div> |
| 193 | <p> |
| 194 | <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a> |
| 195 | </p> |
| 196 | </div> |
| 197 | </div> |
| 198 | <div class="navfooter"> |
| 199 | <hr /> |
| 200 | <table width="100%" summary="Navigation footer"> |
| 201 | <tr> |
| 202 | <td width="40%" align="left"><a accesskey="p" href="envget_intermediate_dir_mode.html">Prev</a> </td> |
| 203 | <td width="20%" align="center"> |
| 204 | <a accesskey="u" href="env.html">Up</a> |
| 205 | </td> |
| 206 | <td width="40%" align="right"> <a accesskey="n" href="envget_memory_max.html">Next</a></td> |
| 207 | </tr> |
| 208 | <tr> |
| 209 | <td width="40%" align="left" valign="top">DB_ENV->get_intermediate_dir_mode() </td> |
| 210 | <td width="20%" align="center"> |
| 211 | <a accesskey="h" href="index.html">Home</a> |
| 212 | </td> |
| 213 | <td width="40%" align="right" valign="top"> DB_ENV->get_memory_max()</td> |
| 214 | </tr> |
| 215 | </table> |
| 216 | </div> |
| 217 | </body> |
| 218 | </html> |