Re:Peter Lawrey Describes Petabyte JVMs
by jkot on Wednesday March 11, 2015 @04:54PM
(#9187192)
Peter also has some great off-heap libraries. It is relatively easy to bypass GC completely.
[ Parent
| on HN ]
Here's Peter's HugeCollections repo[1].
I expected to see some native code being called via JNI, but it's all done in Java.
Re:Peter Lawrey Describes Petabyte JVMs
by aardvark179 on Wednesday March 11, 2015 @07:11PM
(#9188089)
Well, the native code is replaced by the use of sun.misc.Unsafe to do the off heap allocation and access (look in io & storage classes in https://github.com/OpenHFT/Java-Lang/tree/master/lang/src/ma... ).
I wonder what this sort of library will look like when Panama is done, assuming it provides the sort of structured off heap storage support I'm hoping for.
Looks like this is the repo with more recent activity .. https://github.com/OpenHFT/HugeCollections
Re:Peter Lawrey Describes Petabyte JVMs
by jinmingjian on Wednesday March 11, 2015 @09:52PM
(#9188780)
In fact, "to bypass GC completely" is impossible because you still need on-heap objects to access the off-heap stuffs. Note, there is always "no magic".
It is possible to program in java without allocating GC at all. (if you do not count class loader and some other system stuff). Use Unsafe and primitive (on stack) variables. Peter has some nice demos on his blog.
but the on-heap references you keep are only going to be much smaller and thus, alleviate a lot of gc. Offheap storage tend to be things like caching, and caching in java does incur gc costs that you avoid with off-heap stores. It's not a bad solution.