Do you find java.lang.Runtime.freeMemory(), maxMemory() and totalMemory() unreliable in some way?