C - 28 25 characters (full program)
Don't run that one, or your system will quickly get frozen!
main(){while(malloc(9));} As i is incremented, this will tryThe call to allocate biggermalloc will reserve 9 bytes of memory and bigger chunksrequest new memory pages from the operating system regularly. The memory allocated by malloc is immediately leaked as no pointer to the returned address is stored. Once the system has run out of memory (without freeing itRAM and swap space), until or the malloc returns NULL when therememory limit for the process is not enough ressources anymorereached, the program will break out of the while-loop and terminate.