Click here to Skip to main content
15,915,319 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: A question about WMI in VC++ 6.0 Pin
Hamid_RT16-Aug-06 22:28
Hamid_RT16-Aug-06 22:28 
AnswerRe: A question about WMI in VC++ 6.0 Pin
baicker16-Aug-06 22:33
baicker16-Aug-06 22:33 
QuestionNamed Pipes, Disconnect over Pipe Server Failure Pin
Bram van Kampen16-Aug-06 15:18
Bram van Kampen16-Aug-06 15:18 
AnswerRe: Named Pipes, Disconnect over Pipe Server Failure Pin
bob1697216-Aug-06 15:34
bob1697216-Aug-06 15:34 
GeneralRe: Named Pipes, Disconnect over Pipe Server Failure Pin
Bram van Kampen16-Aug-06 15:50
Bram van Kampen16-Aug-06 15:50 
QuestionVirtual Memory Problem in Multithreaded C++ Console Application [modified] Pin
freak13_az16-Aug-06 12:27
freak13_az16-Aug-06 12:27 
AnswerRe: Virtual Memory Problem in Multithreaded C++ Console Application Pin
JWood16-Aug-06 16:04
JWood16-Aug-06 16:04 
AnswerRe: Virtual Memory Problem in Multithreaded C++ Console Application Pin
Bram van Kampen16-Aug-06 16:16
Bram van Kampen16-Aug-06 16:16 
Your Problem is somewhat incomprehensible. Give us some actual (tested) code.
Virtual memory is not something you have control over or should be concerned about! Your program only allocates memory! The operating system decides which part of all memory used should be virtual, your program has no control over that. If your monitor gives a sudden and sharp increase in virtual memory usage untill death, that means invariably that you ended up in an endless loop allocating memory. This has nothng to do with virtual memory anagement! Investigate all for, do,while loops in which memory is (indirectly) (m)allocate(d) Thats where the problem is!
Hint:

Debugging can be troublesome for beginners like me, but here'se a start
Put in the Header File: (Best in stdafx.h, at the bottom)

#define malloc(x) MyMalloc((x),__LINE__,__FILE__)
and write a function:-

void* MyMalloc(size_t Size,int LineNr,LPCSTR FileName){
CString Msg;
Msg.Format("malloc(%i) in File:%s, Line %i\n",FileName,LineNr);
size_t StrLen=Msg.GetLength();
size_t BufSize=StrLen+1>Size ?StrLen+1:Size;
void* pRes=malloc(BufSize+255);
if(pRes==NULL)return NULL:
strcpy(pRes,(LPCSTR)Msg);
return pRes;
}

Avoid writing anything to the objects you Use

Compile and Run the Program, when it dies, it gives a trace log in the bottom of the screen, of all blocks not freed"

Take it from there

LateNightsInNewry

GeneralRe: Virtual Memory Problem in Multithreaded C++ Console Application Pin
Bram van Kampen16-Aug-06 16:22
Bram van Kampen16-Aug-06 16:22 
AnswerRe: Virtual Memory Problem in Multithreaded C++ Console Application Pin
freak13_az17-Aug-06 6:51
freak13_az17-Aug-06 6:51 
QuestionMultitheading Pin
Waldermort16-Aug-06 11:43
Waldermort16-Aug-06 11:43 
AnswerRe: Multitheading Pin
valikac16-Aug-06 12:50
valikac16-Aug-06 12:50 
AnswerRe: Multitheading Pin
Tim Smith16-Aug-06 17:04
Tim Smith16-Aug-06 17:04 
AnswerRe: Multitheading Pin
Stephen Hewitt16-Aug-06 21:16
Stephen Hewitt16-Aug-06 21:16 
QuestionFundamental Question Pin
eggie516-Aug-06 9:33
eggie516-Aug-06 9:33 
AnswerRe: Fundamental Question Pin
eggie516-Aug-06 9:59
eggie516-Aug-06 9:59 
AnswerRe: Fundamental Question Pin
Bram van Kampen16-Aug-06 15:30
Bram van Kampen16-Aug-06 15:30 
QuestionObject Definition Pin
Jay0316-Aug-06 9:21
Jay0316-Aug-06 9:21 
AnswerRe: Object Definition Pin
Zac Howland16-Aug-06 10:11
Zac Howland16-Aug-06 10:11 
GeneralRe: Object Definition Pin
JWood16-Aug-06 11:26
JWood16-Aug-06 11:26 
GeneralRe: Object Definition [modified] Pin
SimonSays16-Aug-06 11:47
SimonSays16-Aug-06 11:47 
GeneralRe: Object Definition Pin
JWood16-Aug-06 15:51
JWood16-Aug-06 15:51 
GeneralRe: Object Definition Pin
Zac Howland17-Aug-06 3:51
Zac Howland17-Aug-06 3:51 
GeneralRe: Object Definition [modified] Pin
Prakash Nadar16-Aug-06 22:01
Prakash Nadar16-Aug-06 22:01 
GeneralRe: Object Definition Pin
Jay0317-Aug-06 5:02
Jay0317-Aug-06 5:02 

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.