I\'m trying to sort a bunch of data such that that the size of data input to the program can be larger than the memory available to the JVM, and handling that requires exter
You can use the Runtime class to get the amount of memory available.
Runtime r = Runtime.getRuntime(); System.out.println(r.totalMemory());
There are various other memory details you can get from the Runtime object - see Runtime class.