Hi, all
I am doing one video processing software, which uses Boost::pool as the buffer manager. but every time pool allocates buffers, it malloc all needed memory at one time. for example, I create one pool object for 1024 B for one chunk, and 16 chunks at first. Pool malloc all the 1024 * 16 (16KB) at one time.
 
this leads to memory allocation error for my application, because I need 8294400B (1920 * 1080 * 4, for one video frame) * 32, that is more than 256 MB. I use default new/delete, so new returns NULL for the third time in my case. but from memory monitor, there are still enough memory free. after tracing into new, I found this is from the Microsoft memory management design and memory fragments.
 
is there any way to set Pool to allocate one chunk by another? for example, when I want one chunk, it allocates 8294400B. and for another time, it does another. so this should solve my issues for the memory usage.
 
after checking the code of Pool, it is all based on contiguous memory. if pool cannot meet my requirement, is there any other option in BOOST?
 
BTW, I am working on Windows 32 bits with MS Visual Studio 2005.
 
Thank you for any comment.
 
Xiaowei


搜索本应是彩色的,快来体验新一代搜索引擎-必应,精美图片每天换哦! 立即试用!