When I compile and run the following code :(using gcc on cygwin)
int *a = malloc(1024*1024*100*sizeof(int));
while(1)
;
The task manager in Windows XP shows memory usage by this process as 2232K, which according to me should have been around 400000K.
When I compile and run the following code :(using gcc on cygwin)
int *a = malloc(1024*1024*400*sizeof(int));
while(1)
;
the memory usage goes down to 1388K;
So, rather than showing an increase, it actually shows a decline.
What could explain this?