Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C++ Libraries / October 2005

Tip: Looking for answers? Try searching our database.

re: Memory leaks

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex Thaman - 04 Oct 2005 17:04 GMT
Can you also post the code you are using to generate the debug report?

-----Original Message-----
From: Nitin@discussions.microsoft.com
Posted At: Thursday, August 25, 2005 9:55 AM
Posted To: microsoft.public.dotnet.languages.vc.libraries
Conversation: Memory leaks
Subject: Memory leaks

The following code shows me a memory leak of 44 bytes:
Can you please explain why I am getting this problem?

#include <iostream>
using namespace std;

int main()
{
  cout << sizeof(int);
}

I am using the VC++6.0 compiler and the CRT Debugging routines give me the
following dump:
0 bytes in 0 Free Blocks.
44 bytes in 5 Normal Blocks.
16 bytes in 0 CRT Blocks.
0 bytes in 0 Ignore Blocks.
0 bytes in 0 Client Blocks.
Largest number used: 890 bytes.
Total allocations: 5286 bytes.
Dumping objects ->
c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {60}
normal block at 0x002F27D0, 5 bytes long.
Data: <true > 74 72 75 65 00
c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {59}
normal block at 0x002F2788, 6 bytes long.
Data: <false > 66 61 6C 73 65 00
c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {58}
normal block at 0x002F2740, 1 bytes long.
Data: < > 00
c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {53}
normal block at 0x002F07B8, 24 bytes long.
Data: <  F     @'/ .   > 9C E3 46 00 01 00 00 00 40 27 2F 00 2E 00 CD CD
c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {47}
normal block at 0x002F10C8, 8 bytes long.
Data: <| F     > 7C E3 46 00 01 00 00 00
Object dump complete.

--Thanks
sergega4@yahoo.fr - 10 Oct 2005 00:03 GMT
In general clicking on the
"> normal block at 0x002F27D0, 5 bytes long." line in te output part, this
will drive you to the place where the not destructed dyn memory have been
instanciated.

The good rule to deal with when using dyn memo is to create a booleen (bool)
turned "true" when allocating dynamically, and testing it when exiting (for
instance in destructor) or refreshing your data to send or not the delete.

Xav

> Can you also post the code you are using to generate the debug report?
>
[quoted text clipped - 44 lines]
>
> --Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.