Is FileChannel#mapall memory needed for the resulting immediately allocated ByteBuffer, or is it allocated only on demand while reading from the buffer?
I just tried matching all 500+ MB files in a trivial test program and looked at the memory usage in this process. (Using both Runtime#totalMemoryand viewing it in the OS X activity monitor for the groovysh process.) Memory usage never transferred 30 MB of memory.
So, can a Java implementation βhideβ some of the memory usage in its own calls? And if so, is there a way to find out what OS X is?
source
share