Boost logo

Boost Users :

Subject: [Boost-users] Possibly Memory Leaks in Boost.Date_Time ?
From: Daniel Vallejos (daniel.vallejos_at_[hidden])
Date: 2009-12-22 13:05:35


Hello!

Memory Leaks in Boost.Date_Time ?

Code:

        #include <boost/date_time.hpp>
        #include <iostream>
        
        using namespace boost::posix_time;
        using namespace std;
        
        int main()
        {
            time_duration interval = seconds(120);
            cout << "interval = " << interval << endl;
        }
        
Valgrind profile:

        $ valgrind ./date_time_test
        ==8666== Memcheck, a memory error detector
        ==8666== Copyright (C) 2002-2009, and GNU GPL'd, by Julian
        Seward et al.
        ==8666== Using Valgrind-3.5.0-Debian and LibVEX; rerun with -h
        for copyright info
        ==8666== Command: ./date_time_test
        ==8666==
        interval = 00:02:00
        ==8666==
        ==8666== HEAP SUMMARY:
        ==8666== in use at exit: 1,595 bytes in 27 blocks
        ==8666== total heap usage: 48 allocs, 21 frees, 5,650 bytes
        allocated
        ==8666==
        ==8666== LEAK SUMMARY:
        ==8666== definitely lost: 0 bytes in 0 blocks
        ==8666== indirectly lost: 0 bytes in 0 blocks
        ==8666== possibly lost: 619 bytes in 20 blocks
        ==8666== still reachable: 976 bytes in 7 blocks
        ==8666== suppressed: 0 bytes in 0 blocks

Environment:
        $ uname -a
        Linux electroforce 2.6.31-15-generic #50-Ubuntu SMP Tue Nov 10
14:53:52
        UTC 2009 x86_64 GNU/Linux
        
        $ g++ --version
        g++ (Ubuntu 4.4.2-5ubuntu1) 4.4.2
        


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