Click here to Skip to main content
15,900,724 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Moving a window Pin
Hamid_RT22-Nov-07 19:12
Hamid_RT22-Nov-07 19:12 
AnswerRe: Moving a window Pin
chandu00422-Nov-07 19:56
chandu00422-Nov-07 19:56 
AnswerRe: Moving a window Pin
kk.tvm22-Nov-07 21:09
kk.tvm22-Nov-07 21:09 
GeneralRe: Moving a window Pin
pierre_ribery22-Nov-07 21:19
pierre_ribery22-Nov-07 21:19 
GeneralRe: Moving a window Pin
ovidiucucu22-Nov-07 22:33
ovidiucucu22-Nov-07 22:33 
GeneralRe: Moving a window Pin
kk.tvm23-Nov-07 19:51
kk.tvm23-Nov-07 19:51 
GeneralRe: Moving a window Pin
Marimuthu.r22-Nov-07 22:38
Marimuthu.r22-Nov-07 22:38 
QuestionMemory allocation related query Pin
Sunil Shindekar22-Nov-07 19:03
Sunil Shindekar22-Nov-07 19:03 
I have written one small program in Visual Studio 6.0 which just goes on allocating the memory using 'new' operator. My thinking was that it will give 'memory full' error once all the physical memory and page file memory is full. So I executed the program nad start observing the Task Manager. As the program is executing, the task manager was showing reduced available size of the physical memory. Once the physical memory is full, it start showing higher PF Usage. When my program game me the 'Memory full' error, the PF usage was just 2.8 GB. My PF size is 4 GB. So still 1.2 GB was unused. Why should the program give 'Memory full' error when there is still 1.2 GB available. My physical memory (RAM) is 512 MB. Any idea why is it so?

Following is the program.

int main(int argc, char* argv[])
{
double dMemAllocated=0;
char *c[64003];
char *s[64003];
int i=0;

while (1)
{
try {
c[i] = new char[40*1024];
s[i] = new char[40*1024];

if(i > 64000)
break;


if((c[i] == NULL) || (s[i] == NULL))
{
cout << "Memory full. Memory Allocated = " << dMemAllocated;
getchar();
}
cout << i++ << "\n";

}
catch(...)
{
cout << "Memory Allocated = " << dMemAllocated;
getchar();
}


dMemAllocated += 80*1024;
}

cout << "Memory Allocated = " << dMemAllocated;
getchar();
return 0;
}
AnswerRe: Memory allocation related query Pin
ovidiucucu22-Nov-07 19:45
ovidiucucu22-Nov-07 19:45 
GeneralRe: Memory allocation related query Pin
Sunil Shindekar22-Nov-07 20:13
Sunil Shindekar22-Nov-07 20:13 
AnswerRe: Memory allocation related query [modified] Pin
ovidiucucu22-Nov-07 21:25
ovidiucucu22-Nov-07 21:25 
AnswerRe: Memory allocation related query Pin
KarstenK22-Nov-07 20:35
mveKarstenK22-Nov-07 20:35 
GeneralRe: Memory allocation related query Pin
Sunil Shindekar22-Nov-07 20:43
Sunil Shindekar22-Nov-07 20:43 
AnswerRe: Memory allocation related query Pin
Florin Crişan22-Nov-07 22:24
Florin Crişan22-Nov-07 22:24 
GeneralRe: Memory allocation related query Pin
ovidiucucu22-Nov-07 22:47
ovidiucucu22-Nov-07 22:47 
GeneralRe: Memory allocation related query Pin
Florin Crişan22-Nov-07 22:54
Florin Crişan22-Nov-07 22:54 
JokeRe: Memory allocation related query Pin
ovidiucucu22-Nov-07 23:21
ovidiucucu22-Nov-07 23:21 
GeneralRe: Memory allocation related query Pin
Sunil Shindekar23-Nov-07 0:02
Sunil Shindekar23-Nov-07 0:02 
GeneralRe: Memory allocation related query Pin
Florin Crişan23-Nov-07 0:19
Florin Crişan23-Nov-07 0:19 
GeneralRe: Memory allocation related query Pin
Florin Crişan23-Nov-07 0:20
Florin Crişan23-Nov-07 0:20 
GeneralRe: Memory allocation related query Pin
Sunil Shindekar23-Nov-07 1:31
Sunil Shindekar23-Nov-07 1:31 
AnswerRe: Memory allocation related query Pin
Luc Pattyn23-Nov-07 9:12
sitebuilderLuc Pattyn23-Nov-07 9:12 
Questionthread pool Pin
Jhony george22-Nov-07 18:10
Jhony george22-Nov-07 18:10 
AnswerRe: thread pool Pin
Cedric Moonen22-Nov-07 20:10
Cedric Moonen22-Nov-07 20:10 
QuestionRe: thread pool Pin
Jhony george22-Nov-07 23:20
Jhony george22-Nov-07 23:20 

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.