Boost logo

Boost Users :

From: rottyguy (rottyguy70_at_[hidden])
Date: 2008-08-15 12:33:57


Hi, I am new to boost and was looking for a little guidance in using the right pool classes to help me with memory fragmentation.

I have a hash_map indexed by a std::string --> smart_ptr<bufferObject>
where bufferObject is a struct that holds a dynamically created char[]
buffer and length integer. As this hash_map will hold millions of
records (gigabytes of data), there will be plenty of objects created/destroyed many times
over the amount of memory available to the system. I would like to
employ a recyclable memory pool (to combat memory fragmentation). Here are my dynamic objects:

key - std:string --> allocates based on a given string during an insert (a few 100 bytes to 2k max)

value - bufferObject --> allocated to be held by the smart_ptr.

bufferObject, itself, will hold dynamically allocated data. These bytes can range from a few hundred bytes to 4k max

hash_map - millions of these key/value pairs created/destroyed.

various vectors that are used throughout to copy over portions of the cache for retrieval.

Any guidance is appreciated.

TIA

      


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net