2
0

jemalloc.3 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482
  1. '\" t
  2. .\" Title: JEMALLOC
  3. .\" Author: Jason Evans
  4. .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
  5. .\" Date: 11/09/2012
  6. .\" Manual: User Manual
  7. .\" Source: jemalloc 3.2.0-0-g87499f6748ebe4817571e817e9f680ccb5bf54a9
  8. .\" Language: English
  9. .\"
  10. .TH "JEMALLOC" "3" "11/09/2012" "jemalloc 3.2.0-0-g87499f6748eb" "User Manual"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. jemalloc \- general purpose memory allocation functions
  32. .SH "LIBRARY"
  33. .PP
  34. This manual describes jemalloc 3\&.2\&.0\-0\-g87499f6748ebe4817571e817e9f680ccb5bf54a9\&. More information can be found at the
  35. \m[blue]\fBjemalloc website\fR\m[]\&\s-2\u[1]\d\s+2\&.
  36. .SH "SYNOPSIS"
  37. .sp
  38. .ft B
  39. .nf
  40. #include <stdlib\&.h>
  41. #include <jemalloc/jemalloc\&.h>
  42. .fi
  43. .ft
  44. .SS "Standard API"
  45. .HP \w'void\ *malloc('u
  46. .BI "void *malloc(size_t\ " "size" ");"
  47. .HP \w'void\ *calloc('u
  48. .BI "void *calloc(size_t\ " "number" ", size_t\ " "size" ");"
  49. .HP \w'int\ posix_memalign('u
  50. .BI "int posix_memalign(void\ **" "ptr" ", size_t\ " "alignment" ", size_t\ " "size" ");"
  51. .HP \w'void\ *aligned_alloc('u
  52. .BI "void *aligned_alloc(size_t\ " "alignment" ", size_t\ " "size" ");"
  53. .HP \w'void\ *realloc('u
  54. .BI "void *realloc(void\ *" "ptr" ", size_t\ " "size" ");"
  55. .HP \w'void\ free('u
  56. .BI "void free(void\ *" "ptr" ");"
  57. .SS "Non\-standard API"
  58. .HP \w'size_t\ malloc_usable_size('u
  59. .BI "size_t malloc_usable_size(const\ void\ *" "ptr" ");"
  60. .HP \w'void\ malloc_stats_print('u
  61. .BI "void malloc_stats_print(void\ " "(*write_cb)" "\ (void\ *,\ const\ char\ *), void\ *" "cbopaque" ", const\ char\ *" "opts" ");"
  62. .HP \w'int\ mallctl('u
  63. .BI "int mallctl(const\ char\ *" "name" ", void\ *" "oldp" ", size_t\ *" "oldlenp" ", void\ *" "newp" ", size_t\ " "newlen" ");"
  64. .HP \w'int\ mallctlnametomib('u
  65. .BI "int mallctlnametomib(const\ char\ *" "name" ", size_t\ *" "mibp" ", size_t\ *" "miblenp" ");"
  66. .HP \w'int\ mallctlbymib('u
  67. .BI "int mallctlbymib(const\ size_t\ *" "mib" ", size_t\ " "miblen" ", void\ *" "oldp" ", size_t\ *" "oldlenp" ", void\ *" "newp" ", size_t\ " "newlen" ");"
  68. .HP \w'void\ (*malloc_message)('u
  69. .BI "void (*malloc_message)(void\ *" "cbopaque" ", const\ char\ *" "s" ");"
  70. .PP
  71. const char *\fImalloc_conf\fR;
  72. .SS "Experimental API"
  73. .HP \w'int\ allocm('u
  74. .BI "int allocm(void\ **" "ptr" ", size_t\ *" "rsize" ", size_t\ " "size" ", int\ " "flags" ");"
  75. .HP \w'int\ rallocm('u
  76. .BI "int rallocm(void\ **" "ptr" ", size_t\ *" "rsize" ", size_t\ " "size" ", size_t\ " "extra" ", int\ " "flags" ");"
  77. .HP \w'int\ sallocm('u
  78. .BI "int sallocm(const\ void\ *" "ptr" ", size_t\ *" "rsize" ", int\ " "flags" ");"
  79. .HP \w'int\ dallocm('u
  80. .BI "int dallocm(void\ *" "ptr" ", int\ " "flags" ");"
  81. .HP \w'int\ nallocm('u
  82. .BI "int nallocm(size_t\ *" "rsize" ", size_t\ " "size" ", int\ " "flags" ");"
  83. .SH "DESCRIPTION"
  84. .SS "Standard API"
  85. .PP
  86. The
  87. \fBmalloc\fR\fB\fR
  88. function allocates
  89. \fIsize\fR
  90. bytes of uninitialized memory\&. The allocated space is suitably aligned (after possible pointer coercion) for storage of any type of object\&.
  91. .PP
  92. The
  93. \fBcalloc\fR\fB\fR
  94. function allocates space for
  95. \fInumber\fR
  96. objects, each
  97. \fIsize\fR
  98. bytes in length\&. The result is identical to calling
  99. \fBmalloc\fR\fB\fR
  100. with an argument of
  101. \fInumber\fR
  102. *
  103. \fIsize\fR, with the exception that the allocated memory is explicitly initialized to zero bytes\&.
  104. .PP
  105. The
  106. \fBposix_memalign\fR\fB\fR
  107. function allocates
  108. \fIsize\fR
  109. bytes of memory such that the allocation\*(Aqs base address is an even multiple of
  110. \fIalignment\fR, and returns the allocation in the value pointed to by
  111. \fIptr\fR\&. The requested
  112. \fIalignment\fR
  113. must be a power of 2 at least as large as
  114. sizeof(\fBvoid *\fR)\&.
  115. .PP
  116. The
  117. \fBaligned_alloc\fR\fB\fR
  118. function allocates
  119. \fIsize\fR
  120. bytes of memory such that the allocation\*(Aqs base address is an even multiple of
  121. \fIalignment\fR\&. The requested
  122. \fIalignment\fR
  123. must be a power of 2\&. Behavior is undefined if
  124. \fIsize\fR
  125. is not an integral multiple of
  126. \fIalignment\fR\&.
  127. .PP
  128. The
  129. \fBrealloc\fR\fB\fR
  130. function changes the size of the previously allocated memory referenced by
  131. \fIptr\fR
  132. to
  133. \fIsize\fR
  134. bytes\&. The contents of the memory are unchanged up to the lesser of the new and old sizes\&. If the new size is larger, the contents of the newly allocated portion of the memory are undefined\&. Upon success, the memory referenced by
  135. \fIptr\fR
  136. is freed and a pointer to the newly allocated memory is returned\&. Note that
  137. \fBrealloc\fR\fB\fR
  138. may move the memory allocation, resulting in a different return value than
  139. \fIptr\fR\&. If
  140. \fIptr\fR
  141. is
  142. \fBNULL\fR, the
  143. \fBrealloc\fR\fB\fR
  144. function behaves identically to
  145. \fBmalloc\fR\fB\fR
  146. for the specified size\&.
  147. .PP
  148. The
  149. \fBfree\fR\fB\fR
  150. function causes the allocated memory referenced by
  151. \fIptr\fR
  152. to be made available for future allocations\&. If
  153. \fIptr\fR
  154. is
  155. \fBNULL\fR, no action occurs\&.
  156. .SS "Non\-standard API"
  157. .PP
  158. The
  159. \fBmalloc_usable_size\fR\fB\fR
  160. function returns the usable size of the allocation pointed to by
  161. \fIptr\fR\&. The return value may be larger than the size that was requested during allocation\&. The
  162. \fBmalloc_usable_size\fR\fB\fR
  163. function is not a mechanism for in\-place
  164. \fBrealloc\fR\fB\fR; rather it is provided solely as a tool for introspection purposes\&. Any discrepancy between the requested allocation size and the size reported by
  165. \fBmalloc_usable_size\fR\fB\fR
  166. should not be depended on, since such behavior is entirely implementation\-dependent\&.
  167. .PP
  168. The
  169. \fBmalloc_stats_print\fR\fB\fR
  170. function writes human\-readable summary statistics via the
  171. \fIwrite_cb\fR
  172. callback function pointer and
  173. \fIcbopaque\fR
  174. data passed to
  175. \fIwrite_cb\fR, or
  176. \fBmalloc_message\fR\fB\fR
  177. if
  178. \fIwrite_cb\fR
  179. is
  180. \fBNULL\fR\&. This function can be called repeatedly\&. General information that never changes during execution can be omitted by specifying "g" as a character within the
  181. \fIopts\fR
  182. string\&. Note that
  183. \fBmalloc_message\fR\fB\fR
  184. uses the
  185. \fBmallctl*\fR\fB\fR
  186. functions internally, so inconsistent statistics can be reported if multiple threads use these functions simultaneously\&. If
  187. \fB\-\-enable\-stats\fR
  188. is specified during configuration, \(lqm\(rq and \(lqa\(rq can be specified to omit merged arena and per arena statistics, respectively; \(lqb\(rq and \(lql\(rq can be specified to omit per size class statistics for bins and large objects, respectively\&. Unrecognized characters are silently ignored\&. Note that thread caching may prevent some statistics from being completely up to date, since extra locking would be required to merge counters that track thread cache operations\&.
  189. .PP
  190. The
  191. \fBmallctl\fR\fB\fR
  192. function provides a general interface for introspecting the memory allocator, as well as setting modifiable parameters and triggering actions\&. The period\-separated
  193. \fIname\fR
  194. argument specifies a location in a tree\-structured namespace; see the
  195. MALLCTL NAMESPACE
  196. section for documentation on the tree contents\&. To read a value, pass a pointer via
  197. \fIoldp\fR
  198. to adequate space to contain the value, and a pointer to its length via
  199. \fIoldlenp\fR; otherwise pass
  200. \fBNULL\fR
  201. and
  202. \fBNULL\fR\&. Similarly, to write a value, pass a pointer to the value via
  203. \fInewp\fR, and its length via
  204. \fInewlen\fR; otherwise pass
  205. \fBNULL\fR
  206. and
  207. \fB0\fR\&.
  208. .PP
  209. The
  210. \fBmallctlnametomib\fR\fB\fR
  211. function provides a way to avoid repeated name lookups for applications that repeatedly query the same portion of the namespace, by translating a name to a \(lqManagement Information Base\(rq (MIB) that can be passed repeatedly to
  212. \fBmallctlbymib\fR\fB\fR\&. Upon successful return from
  213. \fBmallctlnametomib\fR\fB\fR,
  214. \fImibp\fR
  215. contains an array of
  216. \fI*miblenp\fR
  217. integers, where
  218. \fI*miblenp\fR
  219. is the lesser of the number of components in
  220. \fIname\fR
  221. and the input value of
  222. \fI*miblenp\fR\&. Thus it is possible to pass a
  223. \fI*miblenp\fR
  224. that is smaller than the number of period\-separated name components, which results in a partial MIB that can be used as the basis for constructing a complete MIB\&. For name components that are integers (e\&.g\&. the 2 in
  225. "arenas\&.bin\&.2\&.size"), the corresponding MIB component will always be that integer\&. Therefore, it is legitimate to construct code like the following:
  226. .sp
  227. .if n \{\
  228. .RS 4
  229. .\}
  230. .nf
  231. unsigned nbins, i;
  232. int mib[4];
  233. size_t len, miblen;
  234. len = sizeof(nbins);
  235. mallctl("arenas\&.nbins", &nbins, &len, NULL, 0);
  236. miblen = 4;
  237. mallnametomib("arenas\&.bin\&.0\&.size", mib, &miblen);
  238. for (i = 0; i < nbins; i++) {
  239. size_t bin_size;
  240. mib[2] = i;
  241. len = sizeof(bin_size);
  242. mallctlbymib(mib, miblen, &bin_size, &len, NULL, 0);
  243. /* Do something with bin_size\&.\&.\&. */
  244. }
  245. .fi
  246. .if n \{\
  247. .RE
  248. .\}
  249. .SS "Experimental API"
  250. .PP
  251. The experimental API is subject to change or removal without regard for backward compatibility\&. If
  252. \fB\-\-disable\-experimental\fR
  253. is specified during configuration, the experimental API is omitted\&.
  254. .PP
  255. The
  256. \fBallocm\fR\fB\fR,
  257. \fBrallocm\fR\fB\fR,
  258. \fBsallocm\fR\fB\fR,
  259. \fBdallocm\fR\fB\fR, and
  260. \fBnallocm\fR\fB\fR
  261. functions all have a
  262. \fIflags\fR
  263. argument that can be used to specify options\&. The functions only check the options that are contextually relevant\&. Use bitwise or (|) operations to specify one or more of the following:
  264. .PP
  265. \fBALLOCM_LG_ALIGN(\fR\fB\fIla\fR\fR\fB) \fR
  266. .RS 4
  267. Align the memory allocation to start at an address that is a multiple of
  268. (1 << \fIla\fR)\&. This macro does not validate that
  269. \fIla\fR
  270. is within the valid range\&.
  271. .RE
  272. .PP
  273. \fBALLOCM_ALIGN(\fR\fB\fIa\fR\fR\fB) \fR
  274. .RS 4
  275. Align the memory allocation to start at an address that is a multiple of
  276. \fIa\fR, where
  277. \fIa\fR
  278. is a power of two\&. This macro does not validate that
  279. \fIa\fR
  280. is a power of 2\&.
  281. .RE
  282. .PP
  283. \fBALLOCM_ZERO\fR
  284. .RS 4
  285. Initialize newly allocated memory to contain zero bytes\&. In the growing reallocation case, the real size prior to reallocation defines the boundary between untouched bytes and those that are initialized to contain zero bytes\&. If this option is absent, newly allocated memory is uninitialized\&.
  286. .RE
  287. .PP
  288. \fBALLOCM_NO_MOVE\fR
  289. .RS 4
  290. For reallocation, fail rather than moving the object\&. This constraint can apply to both growth and shrinkage\&.
  291. .RE
  292. .PP
  293. \fBALLOCM_ARENA(\fR\fB\fIa\fR\fR\fB) \fR
  294. .RS 4
  295. Use the arena specified by the index
  296. \fIa\fR\&. This macro does not validate that
  297. \fIa\fR
  298. specifies an arena in the valid range\&.
  299. .RE
  300. .PP
  301. The
  302. \fBallocm\fR\fB\fR
  303. function allocates at least
  304. \fIsize\fR
  305. bytes of memory, sets
  306. \fI*ptr\fR
  307. to the base address of the allocation, and sets
  308. \fI*rsize\fR
  309. to the real size of the allocation if
  310. \fIrsize\fR
  311. is not
  312. \fBNULL\fR\&. Behavior is undefined if
  313. \fIsize\fR
  314. is
  315. \fB0\fR\&.
  316. .PP
  317. The
  318. \fBrallocm\fR\fB\fR
  319. function resizes the allocation at
  320. \fI*ptr\fR
  321. to be at least
  322. \fIsize\fR
  323. bytes, sets
  324. \fI*ptr\fR
  325. to the base address of the allocation if it moved, and sets
  326. \fI*rsize\fR
  327. to the real size of the allocation if
  328. \fIrsize\fR
  329. is not
  330. \fBNULL\fR\&. If
  331. \fIextra\fR
  332. is non\-zero, an attempt is made to resize the allocation to be at least
  333. \fIsize\fR + \fIextra\fR)
  334. bytes, though inability to allocate the extra byte(s) will not by itself result in failure\&. Behavior is undefined if
  335. \fIsize\fR
  336. is
  337. \fB0\fR, or if
  338. (\fIsize\fR + \fIextra\fR > \fBSIZE_T_MAX\fR)\&.
  339. .PP
  340. The
  341. \fBsallocm\fR\fB\fR
  342. function sets
  343. \fI*rsize\fR
  344. to the real size of the allocation\&.
  345. .PP
  346. The
  347. \fBdallocm\fR\fB\fR
  348. function causes the memory referenced by
  349. \fIptr\fR
  350. to be made available for future allocations\&.
  351. .PP
  352. The
  353. \fBnallocm\fR\fB\fR
  354. function allocates no memory, but it performs the same size computation as the
  355. \fBallocm\fR\fB\fR
  356. function, and if
  357. \fIrsize\fR
  358. is not
  359. \fBNULL\fR
  360. it sets
  361. \fI*rsize\fR
  362. to the real size of the allocation that would result from the equivalent
  363. \fBallocm\fR\fB\fR
  364. function call\&. Behavior is undefined if
  365. \fIsize\fR
  366. is
  367. \fB0\fR\&.
  368. .SH "TUNING"
  369. .PP
  370. Once, when the first call is made to one of the memory allocation routines, the allocator initializes its internals based in part on various options that can be specified at compile\- or run\-time\&.
  371. .PP
  372. The string pointed to by the global variable
  373. \fImalloc_conf\fR, the \(lqname\(rq of the file referenced by the symbolic link named
  374. /etc/malloc\&.conf, and the value of the environment variable
  375. \fBMALLOC_CONF\fR, will be interpreted, in that order, from left to right as options\&.
  376. .PP
  377. An options string is a comma\-separated list of option:value pairs\&. There is one key corresponding to each
  378. "opt\&.*"
  379. mallctl (see the
  380. MALLCTL NAMESPACE
  381. section for options documentation)\&. For example,
  382. abort:true,narenas:1
  383. sets the
  384. "opt\&.abort"
  385. and
  386. "opt\&.narenas"
  387. options\&. Some options have boolean values (true/false), others have integer values (base 8, 10, or 16, depending on prefix), and yet others have raw string values\&.
  388. .SH "IMPLEMENTATION NOTES"
  389. .PP
  390. Traditionally, allocators have used
  391. \fBsbrk\fR(2)
  392. to obtain memory, which is suboptimal for several reasons, including race conditions, increased fragmentation, and artificial limitations on maximum usable memory\&. If
  393. \fB\-\-enable\-dss\fR
  394. is specified during configuration, this allocator uses both
  395. \fBmmap\fR(2)
  396. and
  397. \fBsbrk\fR(2), in that order of preference; otherwise only
  398. \fBmmap\fR(2)
  399. is used\&.
  400. .PP
  401. This allocator uses multiple arenas in order to reduce lock contention for threaded programs on multi\-processor systems\&. This works well with regard to threading scalability, but incurs some costs\&. There is a small fixed per\-arena overhead, and additionally, arenas manage memory completely independently of each other, which means a small fixed increase in overall memory fragmentation\&. These overheads are not generally an issue, given the number of arenas normally used\&. Note that using substantially more arenas than the default is not likely to improve performance, mainly due to reduced cache performance\&. However, it may make sense to reduce the number of arenas if an application does not make much use of the allocation functions\&.
  402. .PP
  403. In addition to multiple arenas, unless
  404. \fB\-\-disable\-tcache\fR
  405. is specified during configuration, this allocator supports thread\-specific caching for small and large objects, in order to make it possible to completely avoid synchronization for most allocation requests\&. Such caching allows very fast allocation in the common case, but it increases memory usage and fragmentation, since a bounded number of objects can remain allocated in each thread cache\&.
  406. .PP
  407. Memory is conceptually broken into equal\-sized chunks, where the chunk size is a power of two that is greater than the page size\&. Chunks are always aligned to multiples of the chunk size\&. This alignment makes it possible to find metadata for user objects very quickly\&.
  408. .PP
  409. User objects are broken into three categories according to size: small, large, and huge\&. Small objects are smaller than one page\&. Large objects are smaller than the chunk size\&. Huge objects are a multiple of the chunk size\&. Small and large objects are managed by arenas; huge objects are managed separately in a single data structure that is shared by all threads\&. Huge objects are used by applications infrequently enough that this single data structure is not a scalability issue\&.
  410. .PP
  411. Each chunk that is managed by an arena tracks its contents as runs of contiguous pages (unused, backing a set of small objects, or backing one large object)\&. The combination of chunk alignment and chunk page maps makes it possible to determine all metadata regarding small and large allocations in constant time\&.
  412. .PP
  413. Small objects are managed in groups by page runs\&. Each run maintains a frontier and free list to track which regions are in use\&. Allocation requests that are no more than half the quantum (8 or 16, depending on architecture) are rounded up to the nearest power of two that is at least
  414. sizeof(\fBdouble\fR)\&. All other small object size classes are multiples of the quantum, spaced such that internal fragmentation is limited to approximately 25% for all but the smallest size classes\&. Allocation requests that are larger than the maximum small size class, but small enough to fit in an arena\-managed chunk (see the
  415. "opt\&.lg_chunk"
  416. option), are rounded up to the nearest run size\&. Allocation requests that are too large to fit in an arena\-managed chunk are rounded up to the nearest multiple of the chunk size\&.
  417. .PP
  418. Allocations are packed tightly together, which can be an issue for multi\-threaded applications\&. If you need to assure that allocations do not suffer from cacheline sharing, round your allocation requests up to the nearest multiple of the cacheline size, or specify cacheline alignment when allocating\&.
  419. .PP
  420. Assuming 4 MiB chunks, 4 KiB pages, and a 16\-byte quantum on a 64\-bit system, the size classes in each category are as shown in
  421. Table 1\&.
  422. .sp
  423. .it 1 an-trap
  424. .nr an-no-space-flag 1
  425. .nr an-break-flag 1
  426. .br
  427. .B Table\ \&1.\ \&Size classes
  428. .TS
  429. allbox tab(:);
  430. lB rB lB.
  431. T{
  432. Category
  433. T}:T{
  434. Spacing
  435. T}:T{
  436. Size
  437. T}
  438. .T&
  439. l r l
  440. ^ r l
  441. ^ r l
  442. ^ r l
  443. ^ r l
  444. ^ r l
  445. ^ r l
  446. l r l
  447. l r l.
  448. T{
  449. Small
  450. T}:T{
  451. lg
  452. T}:T{
  453. [8]
  454. T}
  455. :T{
  456. 16
  457. T}:T{
  458. [16, 32, 48, \&.\&.\&., 128]
  459. T}
  460. :T{
  461. 32
  462. T}:T{
  463. [160, 192, 224, 256]
  464. T}
  465. :T{
  466. 64
  467. T}:T{
  468. [320, 384, 448, 512]
  469. T}
  470. :T{
  471. 128
  472. T}:T{
  473. [640, 768, 896, 1024]
  474. T}
  475. :T{
  476. 256
  477. T}:T{
  478. [1280, 1536, 1792, 2048]
  479. T}
  480. :T{
  481. 512
  482. T}:T{
  483. [2560, 3072, 3584]
  484. T}
  485. T{
  486. Large
  487. T}:T{
  488. 4 KiB
  489. T}:T{
  490. [4 KiB, 8 KiB, 12 KiB, \&.\&.\&., 4072 KiB]
  491. T}
  492. T{
  493. Huge
  494. T}:T{
  495. 4 MiB
  496. T}:T{
  497. [4 MiB, 8 MiB, 12 MiB, \&.\&.\&.]
  498. T}
  499. .TE
  500. .sp 1
  501. .SH "MALLCTL NAMESPACE"
  502. .PP
  503. The following names are defined in the namespace accessible via the
  504. \fBmallctl*\fR\fB\fR
  505. functions\&. Value types are specified in parentheses, their readable/writable statuses are encoded as
  506. rw,
  507. r\-,
  508. \-w, or
  509. \-\-, and required build configuration flags follow, if any\&. A name element encoded as
  510. <i>
  511. or
  512. <j>
  513. indicates an integer component, where the integer varies from 0 to some upper value that must be determined via introspection\&. In the case of
  514. "stats\&.arenas\&.<i>\&.*",
  515. <i>
  516. equal to
  517. "arenas\&.narenas"
  518. can be used to access the summation of statistics from all arenas\&. Take special note of the
  519. "epoch"
  520. mallctl, which controls refreshing of cached dynamic statistics\&.
  521. .PP
  522. "version" (\fBconst char *\fR) r\-
  523. .RS 4
  524. Return the jemalloc version string\&.
  525. .RE
  526. .PP
  527. "epoch" (\fBuint64_t\fR) rw
  528. .RS 4
  529. If a value is passed in, refresh the data from which the
  530. \fBmallctl*\fR\fB\fR
  531. functions report values, and increment the epoch\&. Return the current epoch\&. This is useful for detecting whether another thread caused a refresh\&.
  532. .RE
  533. .PP
  534. "config\&.debug" (\fBbool\fR) r\-
  535. .RS 4
  536. \fB\-\-enable\-debug\fR
  537. was specified during build configuration\&.
  538. .RE
  539. .PP
  540. "config\&.dss" (\fBbool\fR) r\-
  541. .RS 4
  542. \fB\-\-enable\-dss\fR
  543. was specified during build configuration\&.
  544. .RE
  545. .PP
  546. "config\&.fill" (\fBbool\fR) r\-
  547. .RS 4
  548. \fB\-\-enable\-fill\fR
  549. was specified during build configuration\&.
  550. .RE
  551. .PP
  552. "config\&.lazy_lock" (\fBbool\fR) r\-
  553. .RS 4
  554. \fB\-\-enable\-lazy\-lock\fR
  555. was specified during build configuration\&.
  556. .RE
  557. .PP
  558. "config\&.mremap" (\fBbool\fR) r\-
  559. .RS 4
  560. \fB\-\-enable\-mremap\fR
  561. was specified during build configuration\&.
  562. .RE
  563. .PP
  564. "config\&.munmap" (\fBbool\fR) r\-
  565. .RS 4
  566. \fB\-\-enable\-munmap\fR
  567. was specified during build configuration\&.
  568. .RE
  569. .PP
  570. "config\&.prof" (\fBbool\fR) r\-
  571. .RS 4
  572. \fB\-\-enable\-prof\fR
  573. was specified during build configuration\&.
  574. .RE
  575. .PP
  576. "config\&.prof_libgcc" (\fBbool\fR) r\-
  577. .RS 4
  578. \fB\-\-disable\-prof\-libgcc\fR
  579. was not specified during build configuration\&.
  580. .RE
  581. .PP
  582. "config\&.prof_libunwind" (\fBbool\fR) r\-
  583. .RS 4
  584. \fB\-\-enable\-prof\-libunwind\fR
  585. was specified during build configuration\&.
  586. .RE
  587. .PP
  588. "config\&.stats" (\fBbool\fR) r\-
  589. .RS 4
  590. \fB\-\-enable\-stats\fR
  591. was specified during build configuration\&.
  592. .RE
  593. .PP
  594. "config\&.tcache" (\fBbool\fR) r\-
  595. .RS 4
  596. \fB\-\-disable\-tcache\fR
  597. was not specified during build configuration\&.
  598. .RE
  599. .PP
  600. "config\&.tls" (\fBbool\fR) r\-
  601. .RS 4
  602. \fB\-\-disable\-tls\fR
  603. was not specified during build configuration\&.
  604. .RE
  605. .PP
  606. "config\&.utrace" (\fBbool\fR) r\-
  607. .RS 4
  608. \fB\-\-enable\-utrace\fR
  609. was specified during build configuration\&.
  610. .RE
  611. .PP
  612. "config\&.valgrind" (\fBbool\fR) r\-
  613. .RS 4
  614. \fB\-\-enable\-valgrind\fR
  615. was specified during build configuration\&.
  616. .RE
  617. .PP
  618. "config\&.xmalloc" (\fBbool\fR) r\-
  619. .RS 4
  620. \fB\-\-enable\-xmalloc\fR
  621. was specified during build configuration\&.
  622. .RE
  623. .PP
  624. "opt\&.abort" (\fBbool\fR) r\-
  625. .RS 4
  626. Abort\-on\-warning enabled/disabled\&. If true, most warnings are fatal\&. The process will call
  627. \fBabort\fR(3)
  628. in these cases\&. This option is disabled by default unless
  629. \fB\-\-enable\-debug\fR
  630. is specified during configuration, in which case it is enabled by default\&.
  631. .RE
  632. .PP
  633. "opt\&.lg_chunk" (\fBsize_t\fR) r\-
  634. .RS 4
  635. Virtual memory chunk size (log base 2)\&. The default chunk size is 4 MiB (2^22)\&.
  636. .RE
  637. .PP
  638. "opt\&.dss" (\fBconst char *\fR) r\-
  639. .RS 4
  640. dss (\fBsbrk\fR(2)) allocation precedence as related to
  641. \fBmmap\fR(2)
  642. allocation\&. The following settings are supported: \(lqdisabled\(rq, \(lqprimary\(rq, and \(lqsecondary\(rq (default)\&.
  643. .RE
  644. .PP
  645. "opt\&.narenas" (\fBsize_t\fR) r\-
  646. .RS 4
  647. Maximum number of arenas to use for automatic multiplexing of threads and arenas\&. The default is four times the number of CPUs, or one if there is a single CPU\&.
  648. .RE
  649. .PP
  650. "opt\&.lg_dirty_mult" (\fBssize_t\fR) r\-
  651. .RS 4
  652. Per\-arena minimum ratio (log base 2) of active to dirty pages\&. Some dirty unused pages may be allowed to accumulate, within the limit set by the ratio (or one chunk worth of dirty pages, whichever is greater), before informing the kernel about some of those pages via
  653. \fBmadvise\fR(2)
  654. or a similar system call\&. This provides the kernel with sufficient information to recycle dirty pages if physical memory becomes scarce and the pages remain unused\&. The default minimum ratio is 8:1 (2^3:1); an option value of \-1 will disable dirty page purging\&.
  655. .RE
  656. .PP
  657. "opt\&.stats_print" (\fBbool\fR) r\-
  658. .RS 4
  659. Enable/disable statistics printing at exit\&. If enabled, the
  660. \fBmalloc_stats_print\fR\fB\fR
  661. function is called at program exit via an
  662. \fBatexit\fR(3)
  663. function\&. If
  664. \fB\-\-enable\-stats\fR
  665. is specified during configuration, this has the potential to cause deadlock for a multi\-threaded process that exits while one or more threads are executing in the memory allocation functions\&. Therefore, this option should only be used with care; it is primarily intended as a performance tuning aid during application development\&. This option is disabled by default\&.
  666. .RE
  667. .PP
  668. "opt\&.junk" (\fBbool\fR) r\- [\fB\-\-enable\-fill\fR]
  669. .RS 4
  670. Junk filling enabled/disabled\&. If enabled, each byte of uninitialized allocated memory will be initialized to
  671. 0xa5\&. All deallocated memory will be initialized to
  672. 0x5a\&. This is intended for debugging and will impact performance negatively\&. This option is disabled by default unless
  673. \fB\-\-enable\-debug\fR
  674. is specified during configuration, in which case it is enabled by default unless running inside
  675. \m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2\&.
  676. .RE
  677. .PP
  678. "opt\&.quarantine" (\fBsize_t\fR) r\- [\fB\-\-enable\-fill\fR]
  679. .RS 4
  680. Per thread quarantine size in bytes\&. If non\-zero, each thread maintains a FIFO object quarantine that stores up to the specified number of bytes of memory\&. The quarantined memory is not freed until it is released from quarantine, though it is immediately junk\-filled if the
  681. "opt\&.junk"
  682. option is enabled\&. This feature is of particular use in combination with
  683. \m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2, which can detect attempts to access quarantined objects\&. This is intended for debugging and will impact performance negatively\&. The default quarantine size is 0 unless running inside Valgrind, in which case the default is 16 MiB\&.
  684. .RE
  685. .PP
  686. "opt\&.redzone" (\fBbool\fR) r\- [\fB\-\-enable\-fill\fR]
  687. .RS 4
  688. Redzones enabled/disabled\&. If enabled, small allocations have redzones before and after them\&. Furthermore, if the
  689. "opt\&.junk"
  690. option is enabled, the redzones are checked for corruption during deallocation\&. However, the primary intended purpose of this feature is to be used in combination with
  691. \m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2, which needs redzones in order to do effective buffer overflow/underflow detection\&. This option is intended for debugging and will impact performance negatively\&. This option is disabled by default unless running inside Valgrind\&.
  692. .RE
  693. .PP
  694. "opt\&.zero" (\fBbool\fR) r\- [\fB\-\-enable\-fill\fR]
  695. .RS 4
  696. Zero filling enabled/disabled\&. If enabled, each byte of uninitialized allocated memory will be initialized to 0\&. Note that this initialization only happens once for each byte, so
  697. \fBrealloc\fR\fB\fR
  698. and
  699. \fBrallocm\fR\fB\fR
  700. calls do not zero memory that was previously allocated\&. This is intended for debugging and will impact performance negatively\&. This option is disabled by default\&.
  701. .RE
  702. .PP
  703. "opt\&.utrace" (\fBbool\fR) r\- [\fB\-\-enable\-utrace\fR]
  704. .RS 4
  705. Allocation tracing based on
  706. \fButrace\fR(2)
  707. enabled/disabled\&. This option is disabled by default\&.
  708. .RE
  709. .PP
  710. "opt\&.valgrind" (\fBbool\fR) r\- [\fB\-\-enable\-valgrind\fR]
  711. .RS 4
  712. \m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2
  713. support enabled/disabled\&. This option is vestigal because jemalloc auto\-detects whether it is running inside Valgrind\&. This option is disabled by default, unless running inside Valgrind\&.
  714. .RE
  715. .PP
  716. "opt\&.xmalloc" (\fBbool\fR) r\- [\fB\-\-enable\-xmalloc\fR]
  717. .RS 4
  718. Abort\-on\-out\-of\-memory enabled/disabled\&. If enabled, rather than returning failure for any allocation function, display a diagnostic message on
  719. \fBSTDERR_FILENO\fR
  720. and cause the program to drop core (using
  721. \fBabort\fR(3))\&. If an application is designed to depend on this behavior, set the option at compile time by including the following in the source code:
  722. .sp
  723. .if n \{\
  724. .RS 4
  725. .\}
  726. .nf
  727. malloc_conf = "xmalloc:true";
  728. .fi
  729. .if n \{\
  730. .RE
  731. .\}
  732. .sp
  733. This option is disabled by default\&.
  734. .RE
  735. .PP
  736. "opt\&.tcache" (\fBbool\fR) r\- [\fB\-\-enable\-tcache\fR]
  737. .RS 4
  738. Thread\-specific caching enabled/disabled\&. When there are multiple threads, each thread uses a thread\-specific cache for objects up to a certain size\&. Thread\-specific caching allows many allocations to be satisfied without performing any thread synchronization, at the cost of increased memory use\&. See the
  739. "opt\&.lg_tcache_max"
  740. option for related tuning information\&. This option is enabled by default unless running inside
  741. \m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2\&.
  742. .RE
  743. .PP
  744. "opt\&.lg_tcache_max" (\fBsize_t\fR) r\- [\fB\-\-enable\-tcache\fR]
  745. .RS 4
  746. Maximum size class (log base 2) to cache in the thread\-specific cache\&. At a minimum, all small size classes are cached, and at a maximum all large size classes are cached\&. The default maximum is 32 KiB (2^15)\&.
  747. .RE
  748. .PP
  749. "opt\&.prof" (\fBbool\fR) r\- [\fB\-\-enable\-prof\fR]
  750. .RS 4
  751. Memory profiling enabled/disabled\&. If enabled, profile memory allocation activity\&. See the
  752. "opt\&.prof_active"
  753. option for on\-the\-fly activation/deactivation\&. See the
  754. "opt\&.lg_prof_sample"
  755. option for probabilistic sampling control\&. See the
  756. "opt\&.prof_accum"
  757. option for control of cumulative sample reporting\&. See the
  758. "opt\&.lg_prof_interval"
  759. option for information on interval\-triggered profile dumping, the
  760. "opt\&.prof_gdump"
  761. option for information on high\-water\-triggered profile dumping, and the
  762. "opt\&.prof_final"
  763. option for final profile dumping\&. Profile output is compatible with the included
  764. \fBpprof\fR
  765. Perl script, which originates from the
  766. \m[blue]\fBgperftools package\fR\m[]\&\s-2\u[3]\d\s+2\&.
  767. .RE
  768. .PP
  769. "opt\&.prof_prefix" (\fBconst char *\fR) r\- [\fB\-\-enable\-prof\fR]
  770. .RS 4
  771. Filename prefix for profile dumps\&. If the prefix is set to the empty string, no automatic dumps will occur; this is primarily useful for disabling the automatic final heap dump (which also disables leak reporting, if enabled)\&. The default prefix is
  772. jeprof\&.
  773. .RE
  774. .PP
  775. "opt\&.prof_active" (\fBbool\fR) r\- [\fB\-\-enable\-prof\fR]
  776. .RS 4
  777. Profiling activated/deactivated\&. This is a secondary control mechanism that makes it possible to start the application with profiling enabled (see the
  778. "opt\&.prof"
  779. option) but inactive, then toggle profiling at any time during program execution with the
  780. "prof\&.active"
  781. mallctl\&. This option is enabled by default\&.
  782. .RE
  783. .PP
  784. "opt\&.lg_prof_sample" (\fBssize_t\fR) r\- [\fB\-\-enable\-prof\fR]
  785. .RS 4
  786. Average interval (log base 2) between allocation samples, as measured in bytes of allocation activity\&. Increasing the sampling interval decreases profile fidelity, but also decreases the computational overhead\&. The default sample interval is 512 KiB (2^19 B)\&.
  787. .RE
  788. .PP
  789. "opt\&.prof_accum" (\fBbool\fR) r\- [\fB\-\-enable\-prof\fR]
  790. .RS 4
  791. Reporting of cumulative object/byte counts in profile dumps enabled/disabled\&. If this option is enabled, every unique backtrace must be stored for the duration of execution\&. Depending on the application, this can impose a large memory overhead, and the cumulative counts are not always of interest\&. This option is disabled by default\&.
  792. .RE
  793. .PP
  794. "opt\&.lg_prof_interval" (\fBssize_t\fR) r\- [\fB\-\-enable\-prof\fR]
  795. .RS 4
  796. Average interval (log base 2) between memory profile dumps, as measured in bytes of allocation activity\&. The actual interval between dumps may be sporadic because decentralized allocation counters are used to avoid synchronization bottlenecks\&. Profiles are dumped to files named according to the pattern
  797. <prefix>\&.<pid>\&.<seq>\&.i<iseq>\&.heap, where
  798. <prefix>
  799. is controlled by the
  800. "opt\&.prof_prefix"
  801. option\&. By default, interval\-triggered profile dumping is disabled (encoded as \-1)\&.
  802. .RE
  803. .PP
  804. "opt\&.prof_gdump" (\fBbool\fR) r\- [\fB\-\-enable\-prof\fR]
  805. .RS 4
  806. Trigger a memory profile dump every time the total virtual memory exceeds the previous maximum\&. Profiles are dumped to files named according to the pattern
  807. <prefix>\&.<pid>\&.<seq>\&.u<useq>\&.heap, where
  808. <prefix>
  809. is controlled by the
  810. "opt\&.prof_prefix"
  811. option\&. This option is disabled by default\&.
  812. .RE
  813. .PP
  814. "opt\&.prof_final" (\fBbool\fR) r\- [\fB\-\-enable\-prof\fR]
  815. .RS 4
  816. Use an
  817. \fBatexit\fR(3)
  818. function to dump final memory usage to a file named according to the pattern
  819. <prefix>\&.<pid>\&.<seq>\&.f\&.heap, where
  820. <prefix>
  821. is controlled by the
  822. "opt\&.prof_prefix"
  823. option\&. This option is enabled by default\&.
  824. .RE
  825. .PP
  826. "opt\&.prof_leak" (\fBbool\fR) r\- [\fB\-\-enable\-prof\fR]
  827. .RS 4
  828. Leak reporting enabled/disabled\&. If enabled, use an
  829. \fBatexit\fR(3)
  830. function to report memory leaks detected by allocation sampling\&. See the
  831. "opt\&.prof"
  832. option for information on analyzing heap profile output\&. This option is disabled by default\&.
  833. .RE
  834. .PP
  835. "thread\&.arena" (\fBunsigned\fR) rw
  836. .RS 4
  837. Get or set the arena associated with the calling thread\&. If the specified arena was not initialized beforehand (see the
  838. "arenas\&.initialized"
  839. mallctl), it will be automatically initialized as a side effect of calling this interface\&.
  840. .RE
  841. .PP
  842. "thread\&.allocated" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  843. .RS 4
  844. Get the total number of bytes ever allocated by the calling thread\&. This counter has the potential to wrap around; it is up to the application to appropriately interpret the counter in such cases\&.
  845. .RE
  846. .PP
  847. "thread\&.allocatedp" (\fBuint64_t *\fR) r\- [\fB\-\-enable\-stats\fR]
  848. .RS 4
  849. Get a pointer to the the value that is returned by the
  850. "thread\&.allocated"
  851. mallctl\&. This is useful for avoiding the overhead of repeated
  852. \fBmallctl*\fR\fB\fR
  853. calls\&.
  854. .RE
  855. .PP
  856. "thread\&.deallocated" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  857. .RS 4
  858. Get the total number of bytes ever deallocated by the calling thread\&. This counter has the potential to wrap around; it is up to the application to appropriately interpret the counter in such cases\&.
  859. .RE
  860. .PP
  861. "thread\&.deallocatedp" (\fBuint64_t *\fR) r\- [\fB\-\-enable\-stats\fR]
  862. .RS 4
  863. Get a pointer to the the value that is returned by the
  864. "thread\&.deallocated"
  865. mallctl\&. This is useful for avoiding the overhead of repeated
  866. \fBmallctl*\fR\fB\fR
  867. calls\&.
  868. .RE
  869. .PP
  870. "thread\&.tcache\&.enabled" (\fBbool\fR) rw [\fB\-\-enable\-tcache\fR]
  871. .RS 4
  872. Enable/disable calling thread\*(Aqs tcache\&. The tcache is implicitly flushed as a side effect of becoming disabled (see
  873. "thread\&.tcache\&.flush")\&.
  874. .RE
  875. .PP
  876. "thread\&.tcache\&.flush" (\fBvoid\fR) \-\- [\fB\-\-enable\-tcache\fR]
  877. .RS 4
  878. Flush calling thread\*(Aqs tcache\&. This interface releases all cached objects and internal data structures associated with the calling thread\*(Aqs thread\-specific cache\&. Ordinarily, this interface need not be called, since automatic periodic incremental garbage collection occurs, and the thread cache is automatically discarded when a thread exits\&. However, garbage collection is triggered by allocation activity, so it is possible for a thread that stops allocating/deallocating to retain its cache indefinitely, in which case the developer may find manual flushing useful\&.
  879. .RE
  880. .PP
  881. "arena\&.<i>\&.purge" (\fBunsigned\fR) \-\-
  882. .RS 4
  883. Purge unused dirty pages for arena <i>, or for all arenas if <i> equals
  884. "arenas\&.narenas"\&.
  885. .RE
  886. .PP
  887. "arena\&.<i>\&.dss" (\fBconst char *\fR) rw
  888. .RS 4
  889. Set the precedence of dss allocation as related to mmap allocation for arena <i>, or for all arenas if <i> equals
  890. "arenas\&.narenas"\&. See
  891. "opt\&.dss"
  892. for supported settings\&.
  893. .RE
  894. .PP
  895. "arenas\&.narenas" (\fBunsigned\fR) r\-
  896. .RS 4
  897. Current limit on number of arenas\&.
  898. .RE
  899. .PP
  900. "arenas\&.initialized" (\fBbool *\fR) r\-
  901. .RS 4
  902. An array of
  903. "arenas\&.narenas"
  904. booleans\&. Each boolean indicates whether the corresponding arena is initialized\&.
  905. .RE
  906. .PP
  907. "arenas\&.quantum" (\fBsize_t\fR) r\-
  908. .RS 4
  909. Quantum size\&.
  910. .RE
  911. .PP
  912. "arenas\&.page" (\fBsize_t\fR) r\-
  913. .RS 4
  914. Page size\&.
  915. .RE
  916. .PP
  917. "arenas\&.tcache_max" (\fBsize_t\fR) r\- [\fB\-\-enable\-tcache\fR]
  918. .RS 4
  919. Maximum thread\-cached size class\&.
  920. .RE
  921. .PP
  922. "arenas\&.nbins" (\fBunsigned\fR) r\-
  923. .RS 4
  924. Number of bin size classes\&.
  925. .RE
  926. .PP
  927. "arenas\&.nhbins" (\fBunsigned\fR) r\- [\fB\-\-enable\-tcache\fR]
  928. .RS 4
  929. Total number of thread cache bin size classes\&.
  930. .RE
  931. .PP
  932. "arenas\&.bin\&.<i>\&.size" (\fBsize_t\fR) r\-
  933. .RS 4
  934. Maximum size supported by size class\&.
  935. .RE
  936. .PP
  937. "arenas\&.bin\&.<i>\&.nregs" (\fBuint32_t\fR) r\-
  938. .RS 4
  939. Number of regions per page run\&.
  940. .RE
  941. .PP
  942. "arenas\&.bin\&.<i>\&.run_size" (\fBsize_t\fR) r\-
  943. .RS 4
  944. Number of bytes per page run\&.
  945. .RE
  946. .PP
  947. "arenas\&.nlruns" (\fBsize_t\fR) r\-
  948. .RS 4
  949. Total number of large size classes\&.
  950. .RE
  951. .PP
  952. "arenas\&.lrun\&.<i>\&.size" (\fBsize_t\fR) r\-
  953. .RS 4
  954. Maximum size supported by this large size class\&.
  955. .RE
  956. .PP
  957. "arenas\&.purge" (\fBunsigned\fR) \-w
  958. .RS 4
  959. Purge unused dirty pages for the specified arena, or for all arenas if none is specified\&.
  960. .RE
  961. .PP
  962. "arenas\&.extend" (\fBunsigned\fR) r\-
  963. .RS 4
  964. Extend the array of arenas by appending a new arena, and returning the new arena index\&.
  965. .RE
  966. .PP
  967. "prof\&.active" (\fBbool\fR) rw [\fB\-\-enable\-prof\fR]
  968. .RS 4
  969. Control whether sampling is currently active\&. See the
  970. "opt\&.prof_active"
  971. option for additional information\&.
  972. .RE
  973. .PP
  974. "prof\&.dump" (\fBconst char *\fR) \-w [\fB\-\-enable\-prof\fR]
  975. .RS 4
  976. Dump a memory profile to the specified file, or if NULL is specified, to a file according to the pattern
  977. <prefix>\&.<pid>\&.<seq>\&.m<mseq>\&.heap, where
  978. <prefix>
  979. is controlled by the
  980. "opt\&.prof_prefix"
  981. option\&.
  982. .RE
  983. .PP
  984. "prof\&.interval" (\fBuint64_t\fR) r\- [\fB\-\-enable\-prof\fR]
  985. .RS 4
  986. Average number of bytes allocated between inverval\-based profile dumps\&. See the
  987. "opt\&.lg_prof_interval"
  988. option for additional information\&.
  989. .RE
  990. .PP
  991. "stats\&.cactive" (\fBsize_t *\fR) r\- [\fB\-\-enable\-stats\fR]
  992. .RS 4
  993. Pointer to a counter that contains an approximate count of the current number of bytes in active pages\&. The estimate may be high, but never low, because each arena rounds up to the nearest multiple of the chunk size when computing its contribution to the counter\&. Note that the
  994. "epoch"
  995. mallctl has no bearing on this counter\&. Furthermore, counter consistency is maintained via atomic operations, so it is necessary to use an atomic operation in order to guarantee a consistent read when dereferencing the pointer\&.
  996. .RE
  997. .PP
  998. "stats\&.allocated" (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR]
  999. .RS 4
  1000. Total number of bytes allocated by the application\&.
  1001. .RE
  1002. .PP
  1003. "stats\&.active" (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1004. .RS 4
  1005. Total number of bytes in active pages allocated by the application\&. This is a multiple of the page size, and greater than or equal to
  1006. "stats\&.allocated"\&. This does not include
  1007. "stats\&.arenas\&.<i>\&.pdirty"
  1008. and pages entirely devoted to allocator metadata\&.
  1009. .RE
  1010. .PP
  1011. "stats\&.mapped" (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1012. .RS 4
  1013. Total number of bytes in chunks mapped on behalf of the application\&. This is a multiple of the chunk size, and is at least as large as
  1014. "stats\&.active"\&. This does not include inactive chunks\&.
  1015. .RE
  1016. .PP
  1017. "stats\&.chunks\&.current" (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1018. .RS 4
  1019. Total number of chunks actively mapped on behalf of the application\&. This does not include inactive chunks\&.
  1020. .RE
  1021. .PP
  1022. "stats\&.chunks\&.total" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1023. .RS 4
  1024. Cumulative number of chunks allocated\&.
  1025. .RE
  1026. .PP
  1027. "stats\&.chunks\&.high" (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1028. .RS 4
  1029. Maximum number of active chunks at any time thus far\&.
  1030. .RE
  1031. .PP
  1032. "stats\&.huge\&.allocated" (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1033. .RS 4
  1034. Number of bytes currently allocated by huge objects\&.
  1035. .RE
  1036. .PP
  1037. "stats\&.huge\&.nmalloc" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1038. .RS 4
  1039. Cumulative number of huge allocation requests\&.
  1040. .RE
  1041. .PP
  1042. "stats\&.huge\&.ndalloc" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1043. .RS 4
  1044. Cumulative number of huge deallocation requests\&.
  1045. .RE
  1046. .PP
  1047. "stats\&.arenas\&.<i>\&.dss" (\fBconst char *\fR) r\-
  1048. .RS 4
  1049. dss (\fBsbrk\fR(2)) allocation precedence as related to
  1050. \fBmmap\fR(2)
  1051. allocation\&. See
  1052. "opt\&.dss"
  1053. for details\&.
  1054. .RE
  1055. .PP
  1056. "stats\&.arenas\&.<i>\&.nthreads" (\fBunsigned\fR) r\-
  1057. .RS 4
  1058. Number of threads currently assigned to arena\&.
  1059. .RE
  1060. .PP
  1061. "stats\&.arenas\&.<i>\&.pactive" (\fBsize_t\fR) r\-
  1062. .RS 4
  1063. Number of pages in active runs\&.
  1064. .RE
  1065. .PP
  1066. "stats\&.arenas\&.<i>\&.pdirty" (\fBsize_t\fR) r\-
  1067. .RS 4
  1068. Number of pages within unused runs that are potentially dirty, and for which
  1069. \fBmadvise\fR\fB\fI\&.\&.\&.\fR\fR\fB \fR\fB\fI\fBMADV_DONTNEED\fR\fR\fR
  1070. or similar has not been called\&.
  1071. .RE
  1072. .PP
  1073. "stats\&.arenas\&.<i>\&.mapped" (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1074. .RS 4
  1075. Number of mapped bytes\&.
  1076. .RE
  1077. .PP
  1078. "stats\&.arenas\&.<i>\&.npurge" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1079. .RS 4
  1080. Number of dirty page purge sweeps performed\&.
  1081. .RE
  1082. .PP
  1083. "stats\&.arenas\&.<i>\&.nmadvise" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1084. .RS 4
  1085. Number of
  1086. \fBmadvise\fR\fB\fI\&.\&.\&.\fR\fR\fB \fR\fB\fI\fBMADV_DONTNEED\fR\fR\fR
  1087. or similar calls made to purge dirty pages\&.
  1088. .RE
  1089. .PP
  1090. "stats\&.arenas\&.<i>\&.npurged" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1091. .RS 4
  1092. Number of pages purged\&.
  1093. .RE
  1094. .PP
  1095. "stats\&.arenas\&.<i>\&.small\&.allocated" (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1096. .RS 4
  1097. Number of bytes currently allocated by small objects\&.
  1098. .RE
  1099. .PP
  1100. "stats\&.arenas\&.<i>\&.small\&.nmalloc" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1101. .RS 4
  1102. Cumulative number of allocation requests served by small bins\&.
  1103. .RE
  1104. .PP
  1105. "stats\&.arenas\&.<i>\&.small\&.ndalloc" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1106. .RS 4
  1107. Cumulative number of small objects returned to bins\&.
  1108. .RE
  1109. .PP
  1110. "stats\&.arenas\&.<i>\&.small\&.nrequests" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1111. .RS 4
  1112. Cumulative number of small allocation requests\&.
  1113. .RE
  1114. .PP
  1115. "stats\&.arenas\&.<i>\&.large\&.allocated" (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1116. .RS 4
  1117. Number of bytes currently allocated by large objects\&.
  1118. .RE
  1119. .PP
  1120. "stats\&.arenas\&.<i>\&.large\&.nmalloc" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1121. .RS 4
  1122. Cumulative number of large allocation requests served directly by the arena\&.
  1123. .RE
  1124. .PP
  1125. "stats\&.arenas\&.<i>\&.large\&.ndalloc" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1126. .RS 4
  1127. Cumulative number of large deallocation requests served directly by the arena\&.
  1128. .RE
  1129. .PP
  1130. "stats\&.arenas\&.<i>\&.large\&.nrequests" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1131. .RS 4
  1132. Cumulative number of large allocation requests\&.
  1133. .RE
  1134. .PP
  1135. "stats\&.arenas\&.<i>\&.bins\&.<j>\&.allocated" (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1136. .RS 4
  1137. Current number of bytes allocated by bin\&.
  1138. .RE
  1139. .PP
  1140. "stats\&.arenas\&.<i>\&.bins\&.<j>\&.nmalloc" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1141. .RS 4
  1142. Cumulative number of allocations served by bin\&.
  1143. .RE
  1144. .PP
  1145. "stats\&.arenas\&.<i>\&.bins\&.<j>\&.ndalloc" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1146. .RS 4
  1147. Cumulative number of allocations returned to bin\&.
  1148. .RE
  1149. .PP
  1150. "stats\&.arenas\&.<i>\&.bins\&.<j>\&.nrequests" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1151. .RS 4
  1152. Cumulative number of allocation requests\&.
  1153. .RE
  1154. .PP
  1155. "stats\&.arenas\&.<i>\&.bins\&.<j>\&.nfills" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR \fB\-\-enable\-tcache\fR]
  1156. .RS 4
  1157. Cumulative number of tcache fills\&.
  1158. .RE
  1159. .PP
  1160. "stats\&.arenas\&.<i>\&.bins\&.<j>\&.nflushes" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR \fB\-\-enable\-tcache\fR]
  1161. .RS 4
  1162. Cumulative number of tcache flushes\&.
  1163. .RE
  1164. .PP
  1165. "stats\&.arenas\&.<i>\&.bins\&.<j>\&.nruns" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1166. .RS 4
  1167. Cumulative number of runs created\&.
  1168. .RE
  1169. .PP
  1170. "stats\&.arenas\&.<i>\&.bins\&.<j>\&.nreruns" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1171. .RS 4
  1172. Cumulative number of times the current run from which to allocate changed\&.
  1173. .RE
  1174. .PP
  1175. "stats\&.arenas\&.<i>\&.bins\&.<j>\&.curruns" (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1176. .RS 4
  1177. Current number of runs\&.
  1178. .RE
  1179. .PP
  1180. "stats\&.arenas\&.<i>\&.lruns\&.<j>\&.nmalloc" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1181. .RS 4
  1182. Cumulative number of allocation requests for this size class served directly by the arena\&.
  1183. .RE
  1184. .PP
  1185. "stats\&.arenas\&.<i>\&.lruns\&.<j>\&.ndalloc" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1186. .RS 4
  1187. Cumulative number of deallocation requests for this size class served directly by the arena\&.
  1188. .RE
  1189. .PP
  1190. "stats\&.arenas\&.<i>\&.lruns\&.<j>\&.nrequests" (\fBuint64_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1191. .RS 4
  1192. Cumulative number of allocation requests for this size class\&.
  1193. .RE
  1194. .PP
  1195. "stats\&.arenas\&.<i>\&.lruns\&.<j>\&.curruns" (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR]
  1196. .RS 4
  1197. Current number of runs for this size class\&.
  1198. .RE
  1199. .SH "DEBUGGING MALLOC PROBLEMS"
  1200. .PP
  1201. When debugging, it is a good idea to configure/build jemalloc with the
  1202. \fB\-\-enable\-debug\fR
  1203. and
  1204. \fB\-\-enable\-fill\fR
  1205. options, and recompile the program with suitable options and symbols for debugger support\&. When so configured, jemalloc incorporates a wide variety of run\-time assertions that catch application errors such as double\-free, write\-after\-free, etc\&.
  1206. .PP
  1207. Programs often accidentally depend on \(lquninitialized\(rq memory actually being filled with zero bytes\&. Junk filling (see the
  1208. "opt\&.junk"
  1209. option) tends to expose such bugs in the form of obviously incorrect results and/or coredumps\&. Conversely, zero filling (see the
  1210. "opt\&.zero"
  1211. option) eliminates the symptoms of such bugs\&. Between these two options, it is usually possible to quickly detect, diagnose, and eliminate such bugs\&.
  1212. .PP
  1213. This implementation does not provide much detail about the problems it detects, because the performance impact for storing such information would be prohibitive\&. However, jemalloc does integrate with the most excellent
  1214. \m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2
  1215. tool if the
  1216. \fB\-\-enable\-valgrind\fR
  1217. configuration option is enabled\&.
  1218. .SH "DIAGNOSTIC MESSAGES"
  1219. .PP
  1220. If any of the memory allocation/deallocation functions detect an error or warning condition, a message will be printed to file descriptor
  1221. \fBSTDERR_FILENO\fR\&. Errors will result in the process dumping core\&. If the
  1222. "opt\&.abort"
  1223. option is set, most warnings are treated as errors\&.
  1224. .PP
  1225. The
  1226. \fImalloc_message\fR
  1227. variable allows the programmer to override the function which emits the text strings forming the errors and warnings if for some reason the
  1228. \fBSTDERR_FILENO\fR
  1229. file descriptor is not suitable for this\&.
  1230. \fBmalloc_message\fR\fB\fR
  1231. takes the
  1232. \fIcbopaque\fR
  1233. pointer argument that is
  1234. \fBNULL\fR
  1235. unless overridden by the arguments in a call to
  1236. \fBmalloc_stats_print\fR\fB\fR, followed by a string pointer\&. Please note that doing anything which tries to allocate memory in this function is likely to result in a crash or deadlock\&.
  1237. .PP
  1238. All messages are prefixed by \(lq<jemalloc>:\(rq\&.
  1239. .SH "RETURN VALUES"
  1240. .SS "Standard API"
  1241. .PP
  1242. The
  1243. \fBmalloc\fR\fB\fR
  1244. and
  1245. \fBcalloc\fR\fB\fR
  1246. functions return a pointer to the allocated memory if successful; otherwise a
  1247. \fBNULL\fR
  1248. pointer is returned and
  1249. \fIerrno\fR
  1250. is set to
  1251. ENOMEM\&.
  1252. .PP
  1253. The
  1254. \fBposix_memalign\fR\fB\fR
  1255. function returns the value 0 if successful; otherwise it returns an error value\&. The
  1256. \fBposix_memalign\fR\fB\fR
  1257. function will fail if:
  1258. .PP
  1259. EINVAL
  1260. .RS 4
  1261. The
  1262. \fIalignment\fR
  1263. parameter is not a power of 2 at least as large as
  1264. sizeof(\fBvoid *\fR)\&.
  1265. .RE
  1266. .PP
  1267. ENOMEM
  1268. .RS 4
  1269. Memory allocation error\&.
  1270. .RE
  1271. .PP
  1272. The
  1273. \fBaligned_alloc\fR\fB\fR
  1274. function returns a pointer to the allocated memory if successful; otherwise a
  1275. \fBNULL\fR
  1276. pointer is returned and
  1277. \fIerrno\fR
  1278. is set\&. The
  1279. \fBaligned_alloc\fR\fB\fR
  1280. function will fail if:
  1281. .PP
  1282. EINVAL
  1283. .RS 4
  1284. The
  1285. \fIalignment\fR
  1286. parameter is not a power of 2\&.
  1287. .RE
  1288. .PP
  1289. ENOMEM
  1290. .RS 4
  1291. Memory allocation error\&.
  1292. .RE
  1293. .PP
  1294. The
  1295. \fBrealloc\fR\fB\fR
  1296. function returns a pointer, possibly identical to
  1297. \fIptr\fR, to the allocated memory if successful; otherwise a
  1298. \fBNULL\fR
  1299. pointer is returned, and
  1300. \fIerrno\fR
  1301. is set to
  1302. ENOMEM
  1303. if the error was the result of an allocation failure\&. The
  1304. \fBrealloc\fR\fB\fR
  1305. function always leaves the original buffer intact when an error occurs\&.
  1306. .PP
  1307. The
  1308. \fBfree\fR\fB\fR
  1309. function returns no value\&.
  1310. .SS "Non\-standard API"
  1311. .PP
  1312. The
  1313. \fBmalloc_usable_size\fR\fB\fR
  1314. function returns the usable size of the allocation pointed to by
  1315. \fIptr\fR\&.
  1316. .PP
  1317. The
  1318. \fBmallctl\fR\fB\fR,
  1319. \fBmallctlnametomib\fR\fB\fR, and
  1320. \fBmallctlbymib\fR\fB\fR
  1321. functions return 0 on success; otherwise they return an error value\&. The functions will fail if:
  1322. .PP
  1323. EINVAL
  1324. .RS 4
  1325. \fInewp\fR
  1326. is not
  1327. \fBNULL\fR, and
  1328. \fInewlen\fR
  1329. is too large or too small\&. Alternatively,
  1330. \fI*oldlenp\fR
  1331. is too large or too small; in this case as much data as possible are read despite the error\&.
  1332. .RE
  1333. .PP
  1334. ENOMEM
  1335. .RS 4
  1336. \fI*oldlenp\fR
  1337. is too short to hold the requested value\&.
  1338. .RE
  1339. .PP
  1340. ENOENT
  1341. .RS 4
  1342. \fIname\fR
  1343. or
  1344. \fImib\fR
  1345. specifies an unknown/invalid value\&.
  1346. .RE
  1347. .PP
  1348. EPERM
  1349. .RS 4
  1350. Attempt to read or write void value, or attempt to write read\-only value\&.
  1351. .RE
  1352. .PP
  1353. EAGAIN
  1354. .RS 4
  1355. A memory allocation failure occurred\&.
  1356. .RE
  1357. .PP
  1358. EFAULT
  1359. .RS 4
  1360. An interface with side effects failed in some way not directly related to
  1361. \fBmallctl*\fR\fB\fR
  1362. read/write processing\&.
  1363. .RE
  1364. .SS "Experimental API"
  1365. .PP
  1366. The
  1367. \fBallocm\fR\fB\fR,
  1368. \fBrallocm\fR\fB\fR,
  1369. \fBsallocm\fR\fB\fR,
  1370. \fBdallocm\fR\fB\fR, and
  1371. \fBnallocm\fR\fB\fR
  1372. functions return
  1373. \fBALLOCM_SUCCESS\fR
  1374. on success; otherwise they return an error value\&. The
  1375. \fBallocm\fR\fB\fR,
  1376. \fBrallocm\fR\fB\fR, and
  1377. \fBnallocm\fR\fB\fR
  1378. functions will fail if:
  1379. .PP
  1380. ALLOCM_ERR_OOM
  1381. .RS 4
  1382. Out of memory\&. Insufficient contiguous memory was available to service the allocation request\&. The
  1383. \fBallocm\fR\fB\fR
  1384. function additionally sets
  1385. \fI*ptr\fR
  1386. to
  1387. \fBNULL\fR, whereas the
  1388. \fBrallocm\fR\fB\fR
  1389. function leaves
  1390. \fB*ptr\fR
  1391. unmodified\&.
  1392. .RE
  1393. The
  1394. \fBrallocm\fR\fB\fR
  1395. function will also fail if:
  1396. .PP
  1397. ALLOCM_ERR_NOT_MOVED
  1398. .RS 4
  1399. \fBALLOCM_NO_MOVE\fR
  1400. was specified, but the reallocation request could not be serviced without moving the object\&.
  1401. .RE
  1402. .SH "ENVIRONMENT"
  1403. .PP
  1404. The following environment variable affects the execution of the allocation functions:
  1405. .PP
  1406. \fBMALLOC_CONF\fR
  1407. .RS 4
  1408. If the environment variable
  1409. \fBMALLOC_CONF\fR
  1410. is set, the characters it contains will be interpreted as options\&.
  1411. .RE
  1412. .SH "EXAMPLES"
  1413. .PP
  1414. To dump core whenever a problem occurs:
  1415. .sp
  1416. .if n \{\
  1417. .RS 4
  1418. .\}
  1419. .nf
  1420. ln \-s \*(Aqabort:true\*(Aq /etc/malloc\&.conf
  1421. .fi
  1422. .if n \{\
  1423. .RE
  1424. .\}
  1425. .PP
  1426. To specify in the source a chunk size that is 16 MiB:
  1427. .sp
  1428. .if n \{\
  1429. .RS 4
  1430. .\}
  1431. .nf
  1432. malloc_conf = "lg_chunk:24";
  1433. .fi
  1434. .if n \{\
  1435. .RE
  1436. .\}
  1437. .SH "SEE ALSO"
  1438. .PP
  1439. \fBmadvise\fR(2),
  1440. \fBmmap\fR(2),
  1441. \fBsbrk\fR(2),
  1442. \fButrace\fR(2),
  1443. \fBalloca\fR(3),
  1444. \fBatexit\fR(3),
  1445. \fBgetpagesize\fR(3)
  1446. .SH "STANDARDS"
  1447. .PP
  1448. The
  1449. \fBmalloc\fR\fB\fR,
  1450. \fBcalloc\fR\fB\fR,
  1451. \fBrealloc\fR\fB\fR, and
  1452. \fBfree\fR\fB\fR
  1453. functions conform to ISO/IEC 9899:1990 (\(lqISO C90\(rq)\&.
  1454. .PP
  1455. The
  1456. \fBposix_memalign\fR\fB\fR
  1457. function conforms to IEEE Std 1003\&.1\-2001 (\(lqPOSIX\&.1\(rq)\&.
  1458. .SH "AUTHOR"
  1459. .PP
  1460. \fBJason Evans\fR
  1461. .RS 4
  1462. .RE
  1463. .SH "NOTES"
  1464. .IP " 1." 4
  1465. jemalloc website
  1466. .RS 4
  1467. \%http://www.canonware.com/jemalloc/
  1468. .RE
  1469. .IP " 2." 4
  1470. Valgrind
  1471. .RS 4
  1472. \%http://valgrind.org/
  1473. .RE
  1474. .IP " 3." 4
  1475. gperftools package
  1476. .RS 4
  1477. \%http://code.google.com/p/gperftools/
  1478. .RE