Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::pool memory question
From: Claude (clros_at_[hidden])
Date: 2012-08-21 16:55:27


>In email, your valgrind output does not show up. Perhaps because it
>is not plain text? Everything shows up fine in the web thread.

Opss, excuse me!

This is the simple program:

#include <iostream>
#include <vector>
#include <boost/pool/pool_alloc.hpp>

using namespace std;

int main()
{
    std::vector<int,boost::pool_allocator&lt;int>> myVector;

    for (int64_t i = 0; i < 150000; ++i)
         myVector.push_back(13);

    boost::singleton_pool<boost::pool_allocator_tag,
sizeof(int)>::release_memory();
    return 0;
}

and this is the valgring output:

==2612== HEAP SUMMARY:
==2612== in use at exit: 4,194,296 bytes in 15 blocks
==2612== total heap usage: 15 allocs, 0 frees, 4,194,296 bytes allocated
==2612==
==2612== 4,194,296 bytes in 15 blocks are still reachable in loss record 1
of 1
==2612== at 0x402B031: operator new[](unsigned int, std::nothrow_t
const&) (vg_replace_malloc.c:372)
==2612== by 0x804A0F8: ??? (in
/home/claudio-ubuntu/Scrivania/ProvaPool/bin/Release/ProvaPool)
==2612== by 0x804A4E4: ??? (in
/home/claudio-ubuntu/Scrivania/ProvaPool/bin/Release/ProvaPool)
==2612== by 0x8048C03: ??? (in
/home/claudio-ubuntu/Scrivania/ProvaPool/bin/Release/ProvaPool)
==2612== by 0x41684D2: (below main) (libc-start.c:226)
==2612==
==2612== LEAK SUMMARY:
==2612== definitely lost: 0 bytes in 0 blocks
==2612== indirectly lost: 0 bytes in 0 blocks
==2612== possibly lost: 0 bytes in 0 blocks
==2612== still reachable: 4,194,296 bytes in 15 blocks
==2612== suppressed: 0 bytes in 0 blocks

--
View this message in context: http://boost.2283326.n4.nabble.com/boost-pool-memory-question-tp4634559p4634574.html
Sent from the Boost - Users mailing list archive at Nabble.com.

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