How much memory Windows itself uses depends on so many things that it's completely impossible to give you a fixed number that will work at all times on different systems and under different circumstances. As a rough guideline, you will need to leave something like
Code:
64 * 1024 * 1024 + (8 * memorysize_in_bytes / 4096) * number_of_apps_running
That is in bytes.
The long calculation is to figure out how much memory the page-tables take up, the 64MB is just a guestimate of how much memory kernel, a few drivers, etc is using up.
Note also that the amount of data you can write with fwrite is definitely not limited by the amount of ram in your machine, I could easily fill any size disk with this:
Code:
int main(void)
{
FILE *f = fopen("something.bin", "wb");
__int64 buf[1000];
__int64 n = 0;
for(;;) {
for(i = 0; i < 1000; i++)
buf[i] = n+i;
n += 1000;
if (fwrite(f, buf, sizeof(buf), 1) <= 0)
break;
}
fclose(f);
}
[No, it isn't complete, nor does it good error checking]
--
Mats