Boost logo

Boost Users :

Subject: [Boost-users] fast_pool_allocator + clear memory
From: Uthpal Urubail (uthpal.urubail_at_[hidden])
Date: 2013-06-29 15:52:44


Even after clear, seems to be memory is not cleaned up when I use boost::fast_pool_allocator. Can someone help in correct usage?

typedef std::set<unsigned int, std::less< unsigned int>, boost::fast_pool_allocator< unsigned int> > IDSET;

int main()
{
          IDSET set;
          WriteMemoryUsage();
          for (int i=0;i<1000000;i++)
                   set.insert(i);
          WriteMemoryUsage();
          set.clear();

          WriteMemoryUsage();
          return 1;
}

In WriteMemoryUsage
Processid: 4836
Peak Memory used: 1155072
Working Set Size: 2744320
Page File Usage: 1155072
Processid: 4836
Peak Memory used: 34816000
Working Set Size: 36528128
Page File Usage: 34816000
Processid: 4836
Peak Memory used: 34816000
Working Set Size: 36532224
Page File Usage: 34816000

Regards,
UJ



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