Return-Path: Delivered-To: apmail-logging-log4cxx-user-archive@www.apache.org Received: (qmail 95609 invoked from network); 5 Nov 2009 15:33:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Nov 2009 15:33:33 -0000 Received: (qmail 74906 invoked by uid 500); 5 Nov 2009 15:33:32 -0000 Delivered-To: apmail-logging-log4cxx-user-archive@logging.apache.org Received: (qmail 74858 invoked by uid 500); 5 Nov 2009 15:33:32 -0000 Mailing-List: contact log4cxx-user-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4CXX User" List-Id: Delivered-To: mailing list log4cxx-user@logging.apache.org Received: (qmail 74846 invoked by uid 99); 5 Nov 2009 15:33:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Nov 2009 15:33:32 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [71.74.56.122] (HELO hrndva-omtalb.mail.rr.com) (71.74.56.122) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Nov 2009 15:33:23 +0000 Received: from [192.168.2.155] (really [24.153.164.123]) by hrndva-omta01.mail.rr.com with ESMTP id <20091105153256709.WEUO7124@hrndva-omta01.mail.rr.com> for ; Thu, 5 Nov 2009 15:32:56 +0000 Message-ID: <4AF2F028.1010201@codeware.com> Date: Thu, 05 Nov 2009 09:32:56 -0600 From: Cory Riddell User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Log4CXX User Subject: Re: Memory Leak with MFC References: <4AF21AE6.6050105@carinasystem.co.jp> <4A29963266F94B4687C5260083B1D266252715580A@TFC-NAMSG-01.mgdtfc.tycoflowcontrol.com> In-Reply-To: <4A29963266F94B4687C5260083B1D266252715580A@TFC-NAMSG-01.mgdtfc.tycoflowcontrol.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Patrick is right. Run it a few times and see if the allocation numbers change (124, 1151, and 1152). If you can get it to repeat consistently, set a breakpoint at those allocations to see what it is that's leaking. You could also rebuild using the debug version of new. That way, you will get file and line numbers in the memory dumps. -cory Griffiths, Patrick wrote: > This doesn't show that the leak is or is not log4cxx. > > Keep in mind that log4cxx uses static singleton objects. It's quite possible that what you are seeing is a simply a side effect caused by the ordering of the destruction of static objects. > > -----Original Message----- > From: "山脇健一(Yamawaki Kenichi)" [mailto:k-yamawaki@carinasystem.co.jp] > Sent: Wednesday, November 04, 2009 5:23 PM > To: log4cxx-user@logging.apache.org > Subject: Memory Leak with MFC > > Hi Exparts, > > I use the log4cxx-0.10.0. > I made below programs with MFC. Then I have faced a certain memory leak. > Please teach the method of settlement. > > // leak version (with MFC) > BOOL CLogTestDlg::OnInitDialog() > { > CDialog::OnInitDialog(); > LoggerPtr logger = Logger::getLogger( "test" ); > return TRUE; > } > > ----------------------------------------------------------------- > Detected memory leaks! > Dumping objects -> > {1152} normal block at 0x01B08818, 56 bytes long. > Data: <0 n 0 n 0 n > 30 F1 6E 02 30 F1 6E 02 30 F1 6E 02 00 00 00 00 > {1151} normal block at 0x01B08768, 116 bytes long. > Data: 4C 62 1D 10 64 62 1D 10 8C 2D 6E 02 00 00 00 00 > > -----Omission ------ > > {124} normal block at 0x01B02218, 52 bytes long. > Data: < P l P > C8 50 B0 01 90 6C B0 01 50 BA B0 01 CD CD CD CD > ----------------------------------------------------------------- > > // A program without MFC doesn't leak memory. > int _tmain(int argc, _TCHAR* argv[]) > { > LoggerPtr logger = Logger::getLogger("test"); > return 0; > } > > thanks, > Kenichi > > > > > This e-mail contains privileged and confidential information intended for the use of the addressees named above. If you are not the intended recipient of this e-mail, you are hereby notified that you must not disseminate, copy or take any action in respect of any information contained in it. If you have received this e-mail in error, please notify the sender immediately by e-mail and immediately destroy this e-mail and its attachments. > > >