473,767 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How turn off memory leak dumping?

My Vis C++ program takes forever to exit. Reason: it is dumping potential
memory leaks. I like finding leaks once a month, but not every time I run.
How do I turn mem leak dumping off?

I looked in help, and it said leak dumping is enabled with #define
CRTDBG_MAP_ALLO C ... but I do not have that #define anywhere in my code.

I _do_ have the /RTC1 (same as both /RTCs and /RTCu ) but the help for those
says nothing about memory leaks; and Id like to leave /RTC1 on all the time.

Thanks in advance for any help,
neal

Nov 17 '05 #1
3 3271
My Vis C++ program takes forever to exit. Reason: it is dumping potential
memory leaks. I like finding leaks once a month, but not every time I run.
How do I turn mem leak dumping off?

I looked in help, and it said leak dumping is enabled with #define
CRTDBG_MAP_ALLO C ... but I do not have that #define anywhere in my code.


In non-MFC applications, you can use _CrtSetDbgFlag function.
(Since the leaks are dumped, it is possible that this function is already used somewhere
in the application)

In MFC applications, you can use AfxEnableMemory Tracking function.

Regards,
Oleg
[VC++ MVP]

Nov 17 '05 #2
Hallo Oleg!
In non-MFC applications, you can use _CrtSetDbgFlag function.
(Since the leaks are dumped, it is possible that this function is already used somewhere
in the application)

In MFC applications, you can use AfxEnableMemory Tracking function.


The MFC version finally calls _CrtSetDbgFlag too!

--
Martin Richter [MVP] WWJD
"In C we had to code our own bugs. In C++ we can inherit them."
FAQ : http://www.mpdvc.de
Samples: http://www.codeguru.com http://www.codeproject.com
Nov 17 '05 #3

Hello Martin,
In non-MFC applications, you can use _CrtSetDbgFlag function.
(Since the leaks are dumped, it is possible that this function is already used somewhere
in the application)

In MFC applications, you can use AfxEnableMemory Tracking function.


The MFC version finally calls _CrtSetDbgFlag too!


Yes, it does.

Calling AfxEnableMemory Tracking(FALSE) is just a bit simpler and less error prone
(e.g. because it is natural to use _CrtSetDbgFlag to clear _CRTDBG_LEAK_CH ECK_DF
flag and expect it to suppress the leak report, but in case of MFC it will not work.
Instead _CRTDBG_ALLOC_M EM_DF should be cleared, and that's what
AfxEnableMemory Tracking does)

Oleg

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4867
by: blugus | last post by:
Hi Guys, I've been try to use Dinkum STL library. It workes well first, but report memory leak in MFC Debug Mode. I use Dinkum Unabridged Library for VC++ V4.02, MSVC6, WIN2000 SERVER. I made a dialog based program by MSVC6, inserted simple code to use Dinkum STL Library, and added simple code like this.
1
1474
by: Barkha Shah | last post by:
Hi All, I am looking for a tool/utility that converts the address into source code line. Purpose is that I have written a basic mfc application that purposely has a memory leak.Now at the exit of the application I get a memory dump in the output window as mentioned below. Its a simple program that I know where the memory leak is but in the bigger application I am not able to figure out source code line. Any help on this respect would be...
0
3907
by: Frank Lopez | last post by:
Does anyone know if Microsoft generated a whitepaper on this topic? Does anyone know what the solution is? (meaning, eliminate the leak problem -- I am seeing three memory leaks from dllmodul.cpp(102) similar to what is mentioned below)... I am calling MFC as part of unmanaged code used by the managed code. +--------
7
2437
by: Rich Denis | last post by:
Hello, I have been trying to solve a mysterious memory leak problem and was hoping that you could help me out on my stuck point. First a bit of background. We have two app servers in an app center cluster that are each running a number of web applications. For some reason one of the boxes' asp_wp process keeps recylcing on us. It seems that the memory just grows and grows and then recycles on us. I cam across and have read the...
4
5727
by: ali.jan | last post by:
Hi, It is trivial to load an assembly in a new Application Domain. Is there any way of loading an assembly in a new process? I tried using the Process class like this: Process p = new Process() p.StartInfo.FileName = mStartupFile p.StartInfo.UseShellExecute = False
4
1365
by: Mike C# | last post by:
Hi all, quick question. I have an application I'm running. There are some "fatal" error conditions that could occur during processing, and I want to exit immediately if one comes up. When I put an exit() function call in my code I get a message like this: Detected memory leaks! Dumping objects -> {177} normal block at 0x003864E8, 32 bytes long. Data: <c:\polling\inbou> 63 3A 5C 70 6F 6C 6C 69 6E 67 5C 69 6E 62 6F 75
6
2439
by: eduard.antonyan | last post by:
All I'm doing is going through the webpage and analyzing the data, here's the outline of the code: in OnDocumentComplete(LPCTSTR lpszURL) { IDispatch *pDispatch = GetHtmlDocument(); IHTMLDocument2 *pDoc; IHTMLElement *pBody; BSTR str;
3
5327
by: Jim Land | last post by:
Jack Slocum claims here http://www.jackslocum.com/yui/2006/10/02/3-easy-steps-to-avoid-javascript- memory-leaks/ that "almost every site you visit that uses JavaScript is leaking memory". Anybody know anything about this? Does *Javascript* leak memeory, or does the *browser* leak memory?
22
9362
by: Peter | last post by:
I am using VS2008. I have a Windows Service application which creates Crystal Reports. This is a multi theaded application which can run several reports at one time. My problem - there is a memory leak someplace. I can not detect the memory leak by running several reports by hand, but when I run tha app as a servrice and process few hundred reports there is significant memory leak. The application can consume over 1GB of memory where it...
0
10014
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9960
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8840
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7384
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6656
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5280
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5425
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3931
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3534
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.