Mail Archives: djgpp/1994/05/14/22:14:57
I am just wondering I know that gcc compiled programs can page to disk,
but I have just one question. I was testing this on my 486SLC2 66MHz,
using a dos box in windows (ver. 3.1) and by just using dos (ver. 5.0)
and was wondering why that by running it under windows in a dos box it
takes so long to run, and makes such a big page file where under dos it is
fast and doesn't make a huge page file.
My computer stats: 486SLC2 66MHz, 4 MEG RAM, 85 MEG HD
-------------------------(memtest.c)----------------------------
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define MEMSIZE 1024*1024
void main(void) {
clock_t start = clock();
char *p = NULL;
p = (char *) malloc(MEMSIZE);
if(p == NULL) {
printf("unable to alloc %ld bytes of memory\n",MEMSIZE);
printf("[%ld] msecs.\n",(clock() - start)/1000);
exit(1);
}
system("dir C:\\djgpp\\tmp");
system("mem");
printf("alloced %ld bytes of memory\n",MEMSIZE);
free(p);
system("dir C:\\djgpp\\tmp");
system("mem");
printf("freed %ld bytes of memory\n",MEMSIZE);
printf("[%ld] msecs.\n",(clock() - start)/1000);
exit(0);
}
----------------------------------------------------------------
---------------(output of memtest.c using dos)------------------
Volume in drive C is MICROBYTE
Volume Serial Number is 18EC-180E
Directory of C:\DJGPP\TMP
. <DIR> 02-10-94 12:14a
.. <DIR> 02-10-94 12:14a
PG0506AA AAA 45056 05-14-94 4:38p
3 file(s) 45056 bytes
14063616 bytes free
655360 bytes total conventional memory
655360 bytes available to MS-DOS
504320 largest executable program size
3276800 bytes total contiguous extended memory
0 bytes available contiguous extended memory
1957888 bytes available XMS memory
MS-DOS resident in High Memory Area
alloced 1048576 bytes of memory
Volume in drive C is MICROBYTE
Volume Serial Number is 18EC-180E
Directory of C:\DJGPP\TMP
. <DIR> 02-10-94 12:14a
.. <DIR> 02-10-94 12:14a
PG0506AA AAA 49152 05-14-94 4:38p
3 file(s) 49152 bytes
14059520 bytes free
655360 bytes total conventional memory
655360 bytes available to MS-DOS
504320 largest executable program size
3276800 bytes total contiguous extended memory
0 bytes available contiguous extended memory
1957888 bytes available XMS memory
MS-DOS resident in High Memory Area
freed 1048576 bytes of memory
[439] msecs.
----------------------------------------------------------------
-------(output of memtest.c using dos box in windows)-----------
Volume in drive C is MICROBYTE
Volume Serial Number is 18EC-180E
Directory of C:\DJGPP\TMP
. <DIR> 02-10-94 12:14a
.. <DIR> 02-10-94 12:14a
PG083FAA AAA 1134592 05-14-94 4:39p
3 file(s) 1134592 bytes
12972032 bytes free
655360 bytes total conventional memory
655360 bytes available to MS-DOS
490464 largest executable program size
3276800 bytes total contiguous extended memory
0 bytes available contiguous extended memory
1048576 bytes available XMS memory
MS-DOS resident in High Memory Area
alloced 1048576 bytes of memory
Volume in drive C is MICROBYTE
Volume Serial Number is 18EC-180E
Directory of C:\DJGPP\TMP
. <DIR> 02-10-94 12:14a
.. <DIR> 02-10-94 12:14a
PG083FAA AAA 1142784 05-14-94 4:40p
3 file(s) 1142784 bytes
12963840 bytes free
655360 bytes total conventional memory
655360 bytes available to MS-DOS
490464 largest executable program size
3276800 bytes total contiguous extended memory
0 bytes available contiguous extended memory
1048576 bytes available XMS memory
MS-DOS resident in High Memory Area
freed 1048576 bytes of memory
[41417] msecs.
----------------------------------------------------------------
- Raw text -