Opened 9 years ago
Closed 9 years ago
#9744 closed Bugs (invalid)
boost::lockfree::queue memory issue
Reported by: | Owned by: | timblechmann | |
---|---|---|---|
Milestone: | To Be Determined | Component: | lockfree |
Version: | Boost 1.54.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Queue takes too much memory. For example: sizeof(boost::lockfree::queue<void* , boost::lockfree::fixed_sized<true>, boost::lockfree::capacity<1000> >) == 64196
Pay attention that sizeof(boost::lockfree::queue<void* , boost::lockfree::fixed_sized<true>, boost::lockfree::capacity<10> >) == sizeof(boost::lockfree::queue<boost::array<char, 6 * sizeof(void*)> , boost::lockfree::fixed_sized<true>, boost::lockfree::capacity<10> >) == 836
sizeof(boost::lockfree::queue<void* , boost::lockfree::fixed_sized<true>, boost::lockfree::capacity<11> > ) == 900 Seems like each element takes at least 64 BYTES!!!(while sizeof(void*) == 8)
Test environment: Linux 2.6.32-358.23.2.el6.x86_64 GNU/Linux CentOs 6.4 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)
Thanks, Alexey
the queue is a node-based data structure. please consult the michael/scott paper and try to understand the implementation before opening bugs.