cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Schuller <>
Subject Re: Off-heap caching through ByteBuffer.allocateDirect when JNA not available ?
Date Sun, 13 Nov 2011 20:09:20 GMT
> I would like to know it also - actually is should be similar, plus there are
> no dependencies to sun.misc packages.

I don't remember the discussion, but I assume the reason is that
allocateDirect() is not freeable except by waiting for soft ref
counting. This is enforced by the API in order to enable safe use of
allocated memory without it being possible to use to break out of the
JVM sandbox.

JNA or misc.unsafe allows explicit freeing (at the cost of application
bugs maybe segfaulting the JVM or causing other side-effects; i.e.,
breaking out of the managed runtime sandbox).

/ Peter Schuller (@scode,

View raw message