Here you can find the source of throwOutOfMemoryError()
public static void throwOutOfMemoryError()
//package com.java2s; public class Main { public static void throwOutOfMemoryError() { throw new OutOfMemoryError("java"); }// w w w . j a v a 2s. c o m }