|
Prev: No Spam !!!! test 4 microsoft-news.for-um.de
Next: Port MFC CCriticalSection::CSingleLock to ACE or ??? (NEWBIE ALERT)
From: App shows memory leak on some machines. App shows memory leak on some on 1 May 2008 08:11 Hi, My application (developed in VC++) is running fine on most of the machines(without any memory leak). But, it is showing memory leaks on production machine. Even on development side it is showing memory leaks on few machine. Why it is so? Hardware configuration of these machines are different. But, I think this difference should not create any memory leak in application. My application is using database communication and socket communication APIs. Is there any relation bet Hardware configuration and MDAC version????? Is MDAC 2.82.3959.0 having memory leak problems?? I've checked my code several times with different APIs and tools, but it has no memory leak. Please help me solving the problem. I've tried to solve problem in many ways for a long time, but not getting any output. MDAC versions on these machines are mentioned below. Development machine : 2.81.1128.0 Production machines : 2.82.3959.0 OS : XP SP2, Windows 2003 server
From: Joseph M. Newcomer on 1 May 2008 09:07 How do you detect that there is a memory leak? You assert this is happening without explaining why you think it is so. joe On Thu, 1 May 2008 05:11:01 -0700, App shows memory leak on some machines. <App shows memory leak on some machines.(a)discussions.microsoft.com> wrote: >Hi, > >My application (developed in VC++) is running fine on most of the >machines(without any memory leak). But, it is showing memory leaks on >production machine. Even on development side it is showing memory leaks on >few machine. Why it is so? > >Hardware configuration of these machines are different. But, I think this >difference should not create any memory leak in application. > >My application is using database communication and socket communication APIs. > >Is there any relation bet Hardware configuration and MDAC version????? >Is MDAC 2.82.3959.0 having memory leak problems?? > >I've checked my code several times with different APIs and tools, but it has >no memory leak. Please help me solving the problem. I've tried to solve >problem in many ways for a long time, but not getting any output. > >MDAC versions on these machines are mentioned below. >Development machine : 2.81.1128.0 >Production machines : 2.82.3959.0 > >OS : XP SP2, Windows 2003 server Joseph M. Newcomer [MVP] email: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Prashant on 2 May 2008 10:48 The application is a multithreaded exe involving socket communication. The memory usage in task manager increases when exe is running. It never comes down. In other words, for each thread it increases and never comes down even after that thread dies. Thanks, Digvijay "Joseph M. Newcomer" wrote: > How do you detect that there is a memory leak? You assert this is happening without > explaining why you think it is so. > joe > On Thu, 1 May 2008 05:11:01 -0700, App shows memory leak on some machines. <App shows > memory leak on some machines.(a)discussions.microsoft.com> wrote: > > >Hi, > > > >My application (developed in VC++) is running fine on most of the > >machines(without any memory leak). But, it is showing memory leaks on > >production machine. Even on development side it is showing memory leaks on > >few machine. Why it is so? > > > >Hardware configuration of these machines are different. But, I think this > >difference should not create any memory leak in application. > > > >My application is using database communication and socket communication APIs. > > > >Is there any relation bet Hardware configuration and MDAC version????? > >Is MDAC 2.82.3959.0 having memory leak problems?? > > > >I've checked my code several times with different APIs and tools, but it has > >no memory leak. Please help me solving the problem. I've tried to solve > >problem in many ways for a long time, but not getting any output. > > > >MDAC versions on these machines are mentioned below. > >Development machine : 2.81.1128.0 > >Production machines : 2.82.3959.0 > > > >OS : XP SP2, Windows 2003 server > Joseph M. Newcomer [MVP] > email: newcomer(a)flounder.com > Web: http://www.flounder.com > MVP Tips: http://www.flounder.com/mvp_tips.htm >
From: Joseph M. Newcomer on 2 May 2008 11:41 It is FAR more likely that what happened is that you are failing to close the thread handle of the thread, resulting in a leakage of thread stacks. Are you certain every thread handle is being closed? The task manager may suggest that memory usage is increasing (it is one of the few valid reports about memory it is actually capable of), but you need to rule out lots of other explanations before pointing to MDAC (not that it might not be the cause, but the most common error I've found in multithreaded leaks is stack leakage). I would suggest downloading the free App Verifier from the Microsoft site and turning on all memory management options. joe On Fri, 2 May 2008 07:48:02 -0700, Prashant <Prashant(a)discussions.microsoft.com> wrote: >The application is a multithreaded exe involving socket communication. The >memory usage in task manager increases when exe is running. It never comes >down. In other words, for each thread it increases and never comes down even >after that thread dies. > >Thanks, >Digvijay > >"Joseph M. Newcomer" wrote: > >> How do you detect that there is a memory leak? You assert this is happening without >> explaining why you think it is so. >> joe >> On Thu, 1 May 2008 05:11:01 -0700, App shows memory leak on some machines. <App shows >> memory leak on some machines.(a)discussions.microsoft.com> wrote: >> >> >Hi, >> > >> >My application (developed in VC++) is running fine on most of the >> >machines(without any memory leak). But, it is showing memory leaks on >> >production machine. Even on development side it is showing memory leaks on >> >few machine. Why it is so? >> > >> >Hardware configuration of these machines are different. But, I think this >> >difference should not create any memory leak in application. >> > >> >My application is using database communication and socket communication APIs. >> > >> >Is there any relation bet Hardware configuration and MDAC version????? >> >Is MDAC 2.82.3959.0 having memory leak problems?? >> > >> >I've checked my code several times with different APIs and tools, but it has >> >no memory leak. Please help me solving the problem. I've tried to solve >> >problem in many ways for a long time, but not getting any output. >> > >> >MDAC versions on these machines are mentioned below. >> >Development machine : 2.81.1128.0 >> >Production machines : 2.82.3959.0 >> > >> >OS : XP SP2, Windows 2003 server >> Joseph M. Newcomer [MVP] >> email: newcomer(a)flounder.com >> Web: http://www.flounder.com >> MVP Tips: http://www.flounder.com/mvp_tips.htm >> Joseph M. Newcomer [MVP] email: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm
From: App shows memory leak on some machines. on 6 May 2008 09:01
Thank you Joseph for your reply. I've used AfxBeginThread() function to launch thread and subsequently AfxEndThread() to end it. I tried using CloseHandle() and checked its return value, also checked return value for GetLastError(), to make sure that handle is getting closed. Return values were as expected. But, it made no difference in behaviour of exe. This part of code looks like //-------------------------------- CWinThread* ThPtr = AfxBeginThread(..); bool b = ::CloseHandle(ThPtr->m_hThread); int n = GetLastError(); thread function: ThreadFunc() { .. .. .. AfxEndThread(); returb bRet; } //-------------------------------- I've used socket and DB calls inside thread function. For DB communication, I've used 'msado15.dll'. I'll like to know, in which cases application will behave differently (in terms of memory leaks) on different machine? Thanks, Digvijay "Joseph M. Newcomer" wrote: > It is FAR more likely that what happened is that you are failing to close the thread > handle of the thread, resulting in a leakage of thread stacks. Are you certain every > thread handle is being closed? > > The task manager may suggest that memory usage is increasing (it is one of the few valid > reports about memory it is actually capable of), but you need to rule out lots of other > explanations before pointing to MDAC (not that it might not be the cause, but the most > common error I've found in multithreaded leaks is stack leakage). I would suggest > downloading the free App Verifier from the Microsoft site and turning on all memory > management options. > joe > > On Fri, 2 May 2008 07:48:02 -0700, Prashant <Prashant(a)discussions.microsoft.com> wrote: > > >The application is a multithreaded exe involving socket communication. The > >memory usage in task manager increases when exe is running. It never comes > >down. In other words, for each thread it increases and never comes down even > >after that thread dies. > > > >Thanks, > >Digvijay > > > >"Joseph M. Newcomer" wrote: > > > >> How do you detect that there is a memory leak? You assert this is happening without > >> explaining why you think it is so. > >> joe > >> On Thu, 1 May 2008 05:11:01 -0700, App shows memory leak on some machines. <App shows > >> memory leak on some machines.(a)discussions.microsoft.com> wrote: > >> > >> >Hi, > >> > > >> >My application (developed in VC++) is running fine on most of the > >> >machines(without any memory leak). But, it is showing memory leaks on > >> >production machine. Even on development side it is showing memory leaks on > >> >few machine. Why it is so? > >> > > >> >Hardware configuration of these machines are different. But, I think this > >> >difference should not create any memory leak in application. > >> > > >> >My application is using database communication and socket communication APIs. > >> > > >> >Is there any relation bet Hardware configuration and MDAC version????? > >> >Is MDAC 2.82.3959.0 having memory leak problems?? > >> > > >> >I've checked my code several times with different APIs and tools, but it has > >> >no memory leak. Please help me solving the problem. I've tried to solve > >> >problem in many ways for a long time, but not getting any output. > >> > > >> >MDAC versions on these machines are mentioned below. > >> >Development machine : 2.81.1128.0 > >> >Production machines : 2.82.3959.0 > >> > > >> >OS : XP SP2, Windows 2003 server > >> Joseph M. Newcomer [MVP] > >> email: newcomer(a)flounder.com > >> Web: http://www.flounder.com > >> MVP Tips: http://www.flounder.com/mvp_tips.htm > >> > Joseph M. Newcomer [MVP] > email: newcomer(a)flounder.com > Web: http://www.flounder.com > MVP Tips: http://www.flounder.com/mvp_tips.htm > |