[Bug c++/48391] New: tr1/memory's shared_ptr causing excessive system memory consumption

arch.jslin at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Mar 31 16:56:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48391

           Summary: tr1/memory's shared_ptr causing excessive system
                    memory consumption
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: arch.jslin@gmail.com


Created attachment 23839
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23839
example for the tr1/memory's shared_ptr possible bug.

OS: Windows 7 64-bit
Compiler: MinGW gcc 4.5.2-tdm1 32-bit

As shown in the attachment, the shared_ptr usage in the first part of the main
function will cause excessive system memory consumption (which will not show in
process' memory usage). While the second part of the main function, calling a
multi-threaded task in conjunction with the shared_ptr's memory problem, will
actually cause the OS to throw an exception to abort the program in just a
dozen of seconds.

In this short example I'm pretty sure something is wrong with tr1/memory's
shared_ptr. If you changed to boost/tr1/memory.hpp (and please don't specify
BOOST_HAS_TR1_SHARED_PTR), all codes executed and finished without any problem.



More information about the Gcc-bugs mailing list