Obtaining memory available to JVM at runtime

Posted by Bo Tian on Stack Overflow See other posts from Stack Overflow or by Bo Tian
Published on 2010-06-11T09:38:54Z Indexed on 2010/06/11 9:42 UTC
Read the original article Hit count: 153

Filed under:
|

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 external sort which is much slower than Quicksort.

Is there any way of obtaining memory available to the JVM at runtime such that I could use in place sorting as much as possible, and only switch to Mergesort when data input is too large?

© Stack Overflow or respective owner

Related posts about java

Related posts about sorting