A forkbomb
:(){ :|:& };:
Above is the shortest code which has lot of BAD effects.
It defines a function named ":" (colon) which just calls itself twice. Thus forking the process into two. This just goes on and on till your system runs out of memory.
For more info, read Fork bomb