Limiting object usage - The Polipo Manual
Description: The Polipo Manual

Next: OS usage limits, Previous: Limiting chunk usage, Up: Limiting memory usage

#### 5.3.2 Limiting object usage

Besides limiting chunk usage, it is possible to limit Polipo's memory usage by bounding the number of objects it keeps in memory at any given time. This is done with `objectHighMark` and `publicObjectLowMark`.

The value `objectHighMark` is the absolute maximum of objects held in memory (including resources and server addresses). When the number of in-memory objects that haven't been superseded yet falls below `publicObjectLowMark`, Polipo will stop writing out objects to disk (superseded objects are discarded as soon as possible).

On 32-bit architectures, every object costs 108 bytes of memory, plus storage for every globally unique header that is not handled specially (hopefully negligible), plus an overhead of one word (4 bytes) for every chunk of data in the object.

You may also want to change `objectHashTableSize`. This is the size of the hash table used for holding objects; it should be a power of two and defaults to eight times `objectHighMark`. Increasing this value will reduce the number of objects being written out to disk due to hash table collisions. Every hash table entry costs one word.