Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How you find memory leaks?

Answers were Sorted based on User's Feedback



How you find memory leaks?..

Answer / jawahar

There many ways to find memory leaks, One of the ways is by
using MFC class. And another way is using Purify tools...

CMemorState is a MFC class by which we can find the memory
leaks. Below is a sample code to find the same.

#ifdef _DEBUG
CMemoryState oldState, newState, diffState;
oldState.Checkpoint();
#endif
int* a = new int[10];
#ifdef _DEBUG
newState.Checkpoint();
if(diffState.Difference(oldState, newState))
{
TRACE0("Memory Leaked");
}
#endif

Is This Answer Correct ?    8 Yes 0 No

How you find memory leaks?..

Answer / umesh pai

There is a pretty easiest way to identify whether ur application is having any memory leak. By using the macro called DEBUG_NEW

define this macro on each of urs cpp file.
like #define DEBUG_NEW

then if u run once ur application in debug mode, it will show each variable which has not been released the memory properly.

Is This Answer Correct ?    8 Yes 3 No

How you find memory leaks?..

Answer / gopal sodhani

macro should be
#define new DEBUG_NEW, in such case once you insert this
directive, the preprocessor will insert DEBUG_NEW wherever
you use new, and MFC does the rest.

Is This Answer Correct ?    4 Yes 0 No

How you find memory leaks?..

Answer / nibha

there are various tool like UMDH,DevPartner, through which
can get line number and function name where memory is
leaking

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More MFC Interview Questions

what is the updated verssion in vc++

3 Answers   Aspect,


What is mfc class hierarchy?

0 Answers  


what is the use of AFX_MANAGE_STATE ?

4 Answers   HCL,


Can you explaing the relashionship between document,frame and view ?

2 Answers  


2.create for 10 batch: Employee_Number Employee_name Employee_Dateofjoining Employee_address Employee_salary 1.select the employee name who deriving more than 10 thousand salary and joined before august 08. use structure and pointers

0 Answers   TCS,


1)why we cant create more than one instance of the class Derived from CWinApp

5 Answers   Alstom,


Difference between Debug and Release versions?

4 Answers  


1) Enable or disable a Cancel button at run time?

1 Answers   HCL,


How do you change the properties for a tree view control that is part of the CTreeView class?

1 Answers  


What is the difference between hinsrtance and hprevinstance in WinMain function?

3 Answers  


1.Get string1,string2,string3 1.add string1 and 2,string1 and 3. 2.replace vowels with T 3.count number of T. 4.remove T 5.COPY string1 to stringf. 6.restore string1. print the following 1.Number of T 2.StringF 3.string1+string2+string3 Use pointers and functions

1 Answers  


if no message handler is available for a message then will deal with the message ? does window proving any default mechanism?

2 Answers   Patni,


Categories