According to JNI documentation, it is optional for the JVM to support the GetDirectBufferAddress function. If unsupported, then the function will return null. This is probably a very rare thing, but let's be defensive by checking the return value for null and throwing an exception instead of passing null down to mlock and munlock.
- relates to
HDFS-4949 Centralized cache management in HDFS