26 Aug 20:40
Memoryleaks in boost::pool_allocator
From: Paul Bormans <pbor1234 <at> hotmail.com>
Subject: Memoryleaks in boost::pool_allocator
Newsgroups: gmane.comp.lib.boost.devel
Date: 2008-08-26 18:44:14 GMT
Subject: Memoryleaks in boost::pool_allocator
Newsgroups: gmane.comp.lib.boost.devel
Date: 2008-08-26 18:44:14 GMT
Some time ago i had noticed some strange behavior in the boost pool_allocator regarding its memory usage.
Now that i've found these great mailinglists ;) i've reproduced the error and with some additional
analysis i can post the thing here.
My environment:
- VS2005
- Windows XP
- Boost 1_34_1 with BOOST_ALL_DYN_LINK set (if it makes a difference)
- Running release build
The test code:
{
std::pair<int, int> pairStart(m_spLeakDetection->ReportLeaks(_T("boost test 1a")));
{
std::vector<int> v;
std::pair<int, int> pairInterim2(m_spLeakDetection->ReportLeaks(_T("boost test 1b"))); //0 bytes
(only stack memory used)
for (int i = 0; i < 1000; ++i) { v.push_back(5); }
std::pair<int, int> pairInterim3(m_spLeakDetection->ReportLeaks(_T("boost test 1c"))); //4264
bytes in 1 block
v.clear();
}
std::pair<int, int> pairInterim4(m_spLeakDetection->ReportLeaks(_T("boost test 1d"))); //0 bytes
}
{
std::pair<int, int> pairStart(m_spLeakDetection->ReportLeaks(_T("boost test 2a")));
{
std::vector<int, boost::pool_allocator<int> > v;
(Continue reading)
RSS Feed