question about Unsafe.allocateInstance
Li Li
fancyerii at gmail.com
Fri Dec 23 03:14:14 PST 2011
hi all,
I want to allocate and free memory as c/c++ language and I found the
Unsafe in hotspot vm. I know the danger of using this class. But I still
want to try it.
allocateMemory and freeMemory are hard to use because I can't deal
with primitive types such as int long and need convert them to byte arrays.
And I also find a method named allocateInstance, which seems what I
want. it just allocate space for this object. I don't know the memory is in
heap or direct memory. if it's in direct memory, it should exist a method
like freeInstance, but I don't find such one.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20111223/ca2afc85/attachment.html
More information about the hotspot-gc-use
mailing list