Skip to main content
Edited explanation as the mentioned counter variable does no longer exist
Source Link

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.

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 try to allocate bigger and bigger chunks of memory (without freeing it), until the malloc returns NULL when there is not enough ressources anymore.

C - 28 25 characters (full program)

Don't run that one, or your system will quickly get frozen!

main(){while(malloc(9));} 

The call to malloc will reserve 9 bytes of memory and request 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 (RAM and swap space) or the memory limit for the process is reached, the program will break out of the while-loop and terminate.

added 17 characters in body
Source Link
Mathieu Rodic
  • 1.2k
  • 1
  • 9
  • 25

C - 2828 25 characters (full program)

Don't run that one, or your system will quickly get frozen!

main(i){while(malloc(++i9));} 

As i is incremented, this will try to allocate bigger and bigger chunks of memory (without freeing it), until the malloc returns NULL when there is not enough ressources anymore.

C - 28 characters (full program)

Don't run that one, or your system will quickly get frozen!

main(i){while(malloc(++i));} 

As i is incremented, this will try to allocate bigger and bigger chunks of memory (without freeing it), until the malloc returns NULL when there is not enough ressources anymore.

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 try to allocate bigger and bigger chunks of memory (without freeing it), until the malloc returns NULL when there is not enough ressources anymore.

added 27 characters in body
Source Link
Mathieu Rodic
  • 1.2k
  • 1
  • 9
  • 25

C - 28 characters (27full program)

Don't run that one, or your system will quickly get frozen!

int i=1;whilemain(i){while(malloc(i++++i));} 

As i is incremented, this will try to allocate bigger and bigger chunks of memory (without freeing it), until the malloc returns NULL when there is not enough ressources anymore.

C (27)

Don't run that one, or your system will quickly get frozen!

int i=1;while(malloc(i++)); 

As i is incremented, this will try to allocate bigger and bigger chunks of memory (without freeing it), until the malloc returns NULL when there is not enough ressources anymore.

C - 28 characters (full program)

Don't run that one, or your system will quickly get frozen!

main(i){while(malloc(++i));} 

As i is incremented, this will try to allocate bigger and bigger chunks of memory (without freeing it), until the malloc returns NULL when there is not enough ressources anymore.

Source Link
Mathieu Rodic
  • 1.2k
  • 1
  • 9
  • 25
Loading