/home/caleb/ASDV-Java/Semester 2/Assignments/lab7_CalebFontenot/src/main/java/com/calebfontenot/lab7_calebfontenot/OOM.java
/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.calebfontenot.lab7_calebfontenot;

/**
 *
 * @author caleb
 */
public class OOM {
    public static void main(String[] args)
    {
        try {
        Integer[][] oomArray = new Integer[20000][20000];
        for (int i = 0; i < oomArray.length; ++i ) {
            for (int j = 0; j < oomArray.length; ++j ) {
                oomArray[i][j] = i * j;
                //System.out.println(oomArray[i][j]);
            }
        }
    } catch (OutOfMemoryError ex) {
            System.out.println("Out of memory! " + ex);
    }
    }
}