/usr/share/polipo/www/doc/Chunk-memory.html is in polipo 1.0.4.1-1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | <html lang="en">
<head>
<title>Chunk memory - The Polipo Manual</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="The Polipo Manual">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Memory-usage.html#Memory-usage" title="Memory usage">
<link rel="prev" href="Memory-usage.html#Memory-usage" title="Memory usage">
<link rel="next" href="Malloc-memory.html#Malloc-memory" title="Malloc memory">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 2003 -- 2006 by Juliusz Chroboczek.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="Chunk-memory"></a>
<p>
Next: <a rel="next" accesskey="n" href="Malloc-memory.html#Malloc-memory">Malloc memory</a>,
Previous: <a rel="previous" accesskey="p" href="Memory-usage.html#Memory-usage">Memory usage</a>,
Up: <a rel="up" accesskey="u" href="Memory-usage.html#Memory-usage">Memory usage</a>
<hr>
</div>
<h3 class="section">5.1 Chunk memory</h3>
<p><a name="index-CHUNK_005fSIZE-224"></a><a name="index-MALLOC_005fCHUNKS-225"></a><a name="index-chunk-226"></a><a name="index-memory-227"></a>
Most of the memory used by Polipo is stored in chunks, fixed-size
blocks of memory; the size of a chunk is defined by the compile-time
constant <code>CHUNK_SIZE</code>, and defaults to 4096 bytes on 32-bit
platforms, 8192 on 64-bit ones. Chunks are used for storing object
data (bodies of instances) and for temporary I/O buffers. Increasing
the chunk size increases performance somewhat, but at the cost of
larger granularity of allocation and hence larger memory usage.
<p>By default, Polipo uses a hand-crafted memory allocator based on
<code>mmap</code>(2) (<code>VirtualAlloc</code> under Windows) for allocating
chunks; while this is very slightly faster than the stock memory
allocator, its main benefit is that it limits memory fragmentation.
It is possible to disable the chunk allocator, and use
<code>malloc</code>(3) for all memory allocation, by defining
<code>MALLOC_CHUNKS</code> at compile time; this is probably only useful for
debugging.
<p>There is one assumption made about <code>CHUNK_SIZE</code>:
<code>CHUNK_SIZE</code> multiplied by the number of bits in an
<code>unsigned int</code> (actually in a <code>ChunkBitmap</code> — see
<samp><span class="file">chunk.c</span></samp>) must be a multiple of the page size, which is 4096 on
most systems (8192 on Alpha, 65536 on Windows — go figure).
<p>As all network I/O will be performed in units of one to two chunks,
<code>CHUNK_SIZE</code> should be at least equal to your network interface's
MTU (typically 1500 bytes). Additionally, as much I/O will be done at
<code>CHUNK_SIZE</code>-aligned addresses, <code>CHUNK_SIZE</code> should ideally
be a multiple of the page size.
<p>In summary, 2048, 4096, 8192 and 16384 are good choices for
<code>CHUNK_SIZE</code>.
</body></html>
|