Google Groups

Re: Locality of Memory

Rüdiger Möller Jun 17, 2014 8:32 AM
Posted in group: mechanical-sympathy
Yup. As memory keeps getting cheaper, Java cannot profit except going off heap or use Azul Zing. Either improve concurrent GC or reduce the amount of references required to model data structures in Java.
However the current Value Type proposal (though well thought) will put another hit onto Java's simplicity and pureness .. I am not completely sold on that, there are a lot of implications to the language.

I'd rather want to see something along the lines of defining the "valueness" at referencee site

final byval char[] x = new char[100];
final byval MyClass mine = new MyClass(x,y); // immediate construction required. No polymorphism.

any attempt to create a reference to those objects could be forbidden at compile time (e.g only allow direct access like "mine.*" and "x[]" ). Same goes to assignment. This way side-effects to the language are minimized, while the ability to create "inline" structured data is kept (at cost of convenience).

Am Montag, 16. Juni 2014 13:53:03 UTC+2 schrieb Martin Thompson:
I keep seeing more and more examples of how Java folk get tripped up when dealing with anything beyond trivial amounts of in-memory data. Locality of reference and cache effects are so important even for modest data volumes.

Here is an amusing example from the IBM folk.

Let's hope we get some progress in Java 9 with Value Types and associated proposals. If we don't address this then the need to go off heap just keeps getting stronger.