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

2011-03-31 Thread arch.jslin at gmail dot com
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: unassig...@gcc.gnu.org
ReportedBy: arch.js...@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.


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

2011-03-31 Thread arch.jslin at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48391

--- Comment #3 from Johnson Lin  2011-03-31 
17:38:47 UTC ---
Many thanks for the brief and clear explanation. :)