Click here to Skip to main content
16,008,010 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDestroy the memory Pin
Anu_Bala15-Jun-07 20:18
Anu_Bala15-Jun-07 20:18 
AnswerRe: Destroy the memory Pin
Mark Salsbery16-Jun-07 6:55
Mark Salsbery16-Jun-07 6:55 
Questiondelete this within the class function causing problems Pin
Cyrilix15-Jun-07 18:17
Cyrilix15-Jun-07 18:17 
GeneralRe: delete this within the class function causing problems Pin
Matthew Faithfull16-Jun-07 0:18
Matthew Faithfull16-Jun-07 0:18 
GeneralRe: delete this within the class function causing problems Pin
Cyrilix16-Jun-07 5:08
Cyrilix16-Jun-07 5:08 
AnswerRe: delete this within the class function causing problems Pin
Matthew Faithfull16-Jun-07 5:24
Matthew Faithfull16-Jun-07 5:24 
GeneralRe: delete this within the class function causing problems Pin
Cyrilix16-Jun-07 6:06
Cyrilix16-Jun-07 6:06 
AnswerRe: delete this within the class function causing problems Pin
Stephen Hewitt17-Jun-07 12:55
Stephen Hewitt17-Jun-07 12:55 
I give the following advice about once a month (recently every few days); it often helps me track down the nastier heap errors:

Try enabling the page heap[^] for your process. Follow these steps:
1. Download and install WinDBG[^].
2. Select “Start”->“All Programs”->“Debugging Tools for Windows”->“Global Flags”.
3. Select the “Image File” tab.
4. In the “Image: (TAB to refresh)” edit control enter the name of your app then press TAB. Just the name with the extension; not the full path.
5. Tick the following:
- “Enable page heap”
- “Enable heap tail checking”
- “Enable heap free checking”
- “Enable heap parameter checking”
- “Enable heap validation on call”
- “Create user mode stack trace database”
6. Press “Apply”.
7. Debug your application. Any debugger will do but with WinDBG you have access to the stack traces of allocations via the !heap –p –a command, for example. When a heap problem is detected a breakpoint will be generated.
8. When done un-tick all the options you ticked, press “Apply” then dismiss GFlags. This step is important as if it’s skipped all applications named as entered in step 4 will run with the page heap enabled.

Note that when using the page heap your application will run much slower than normal and consume way more memory. It’s good to have a beefy machine to do such tests; and such tests should be ran regularly on all applications you develop as part of regular testing activities. If I find a part of my application that’s too slow with the page heap enabled I optimize the memory allocation in that region.


Steve

GeneralRe: delete this within the class function causing problems Pin
Cyrilix17-Jun-07 17:18
Cyrilix17-Jun-07 17:18 
QuestionCreate Standart Animation With V C++ Pin
san_sui15-Jun-07 17:08
san_sui15-Jun-07 17:08 
AnswerRe: Create Standart Animation With V C++ Pin
Hamid_RT15-Jun-07 19:02
Hamid_RT15-Jun-07 19:02 
Questionerror c3409 [modified] Pin
moonraker92815-Jun-07 12:53
moonraker92815-Jun-07 12:53 
AnswerRe: error c3409 Pin
David Crow15-Jun-07 15:58
David Crow15-Jun-07 15:58 
GeneralRe: error c3409 [modified] Pin
moonraker92815-Jun-07 17:09
moonraker92815-Jun-07 17:09 
GeneralRe: error c3409 Pin
David Crow16-Jun-07 15:42
David Crow16-Jun-07 15:42 
QuestionHelp with conversion to VC* - Linker error Pin
b644715-Jun-07 12:31
b644715-Jun-07 12:31 
AnswerRe: Help with conversion to VC* - Linker error Pin
kvrnkiran19-Jun-07 0:02
kvrnkiran19-Jun-07 0:02 
GeneralRe: Help with conversion to VC* - Linker error Pin
b644719-Jun-07 13:51
b644719-Jun-07 13:51 
Questionhaving a class be a member of itself Pin
moonraker92815-Jun-07 12:27
moonraker92815-Jun-07 12:27 
AnswerRe: having a class be a member of itself Pin
markkuk15-Jun-07 12:46
markkuk15-Jun-07 12:46 
GeneralRe: having a class be a member of itself Pin
moonraker92815-Jun-07 12:49
moonraker92815-Jun-07 12:49 
QuestionGDI+ Effects: Blur BrightnessContrast, etc? Pin
HappyFunBall15-Jun-07 11:12
HappyFunBall15-Jun-07 11:12 
AnswerRe: GDI+ Effects: Blur BrightnessContrast, etc? Pin
Mark Salsbery15-Jun-07 12:59
Mark Salsbery15-Jun-07 12:59 
QuestionAuthenticated user Pin
RomTibi15-Jun-07 9:04
RomTibi15-Jun-07 9:04 
AnswerRe: Authenticated user Pin
Matthew Faithfull15-Jun-07 9:11
Matthew Faithfull15-Jun-07 9:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.