Page 1 of 1

How to allocate 1.6TB of ram

Posted: Sun Nov 22, 2009 9:42 pm
by Red Squirrel
First you need Linux, and a 64-bit processor...

Image

Good luck trying that in Windows. :P

Note: there's only 8GB of ram on that server. It froze up for a while and I thought I had maybe lost my VNC connection but it suddenly started responding again so I could CTRL+C out of it

Server running as if nothing ever happened.

The code behind this:

Code: Select all

#include <fstream>
#include <iostream>

using namespace std;


void WriteNum(int num)
{
    fstream fout("MB.txt",ios::out);
    fout<<num<<"MB";
    fout.close();    
}


int main()
{    
    unsigned long int i=0;
    
    while(1)
    {
        char * nomnomnom = new char[1048576]; //eat one MB of ram
        i++;
        WriteNum(i);           
        cout<<"
Eating "<<i<<"MB...";     
    }   
	
	return 0;
}

Archived topic from AOV, old topic ID:4846, old post ID:31365