You have run the system out of memory. The OS is responding to what you did. OOM error is valid.
Is there a reason for this code, because I can't think of any possible reason to do this?