I play with a specific caching algorithm, which is somewhat complicated. In principle, he needs to allocate a lot of small objects (double arrays, from 1 to 256 elements), with objects accessible through the displayed value, map[key] = array . the time to the initialized array can be quite large, usually more than 10 thousand processor cycles.
By lots, I mean about a gigabyte in general. objects, you may need to pop up / click as necessary, usually in random places, one object at a time. the lifetime of the object is usually long, minutes or more, however, the object can be distributed / released several times during the duration of the program.
What would be a good strategy to avoid memory fragmentation while maintaining a reasonable dedicated disadaptation rate?
I use C ++, so I can use new and malloc. Thanks.
I know that such issues on the website, the efficient distribution of many short-lived small objects are somewhat different, thread safety is not an immediate problem for me.
my development platform is Intel Xeon, the Linux operating system. Ideally, I would like to work with PPC linux, but for me this is not the most important.
c ++ memory-management
Anycorn
source share