Java tutorial
//package com.java2s; public class Main { public static final int HEAP_SIZE_LARGE = 48 * 1024 * 1024; public static boolean isLargeHeap() { return Runtime.getRuntime().maxMemory() > HEAP_SIZE_LARGE; } }