Will a Java expert (JVM developer) please answer this question? Thank you. How impossible would it be to add a delete keyword to the JVM, and why?
Java does memory recovery strictly by garbage collection. To delete an object remove all references to that object and wait. A "delete now" operation imposes requirements on implementations that are not strictly required. Any advantages gained from destructors can be realized via explicit cleanup methods and (as a hedge against mis-use) state checking for initialized and destroyed objects. A delete operation also add…
Eclipse OpenJ9 – Open-source JVM
71–80 of 105 posts
Re: Eclipse OpenJ9 – Open-source JVM
#72Earlier quoted context omitted.
> The RTSJ solution is to simply pre-allocate everything you could ever want and reuse that. That's not the RTSJ solution. RTSJ uses arenas, which are great if you have regular allocation/deallocation cycles, like, say, a frame in a game.
> That's not the RTSJ solution. RTSJ uses arenas, which are great if you have regular allocation/deallocation cycles, like, say, a frame in a game. So how do I get a user’s Oracle JRE installation to use arenas? The only realistic scenario is to preallocate and reuse.
Re: Eclipse OpenJ9 – Open-source JVM
#73Earlier quoted context omitted.
I've been a Java dev for a decade, and I never once used anything but Sun / Oracle's version (now OpenJDK, which is almost the same thing). I really have no idea who ever used these other JVM implementations. I'm guessing it would be companies with specialized hardware such as IBM mainframes or finance firms paying a lot of money to squeeze out performance with WebLogic. Either because of poor marketing or some other…
I used JRockIT for some stuff. We found it to beat HotSpot (at the time) in some of our use cases. Eventually they got brought in house and HotSpot gained those speed improvements. One of the things that was really useful with it was Mission Control, which didn't exist to the same degree with the HotSpot VM.
Re: Eclipse OpenJ9 – Open-source JVM
#74Will a Java expert (JVM developer) please answer this question? Thank you. How impossible would it be to add a delete keyword to the JVM, and why?
If you want manual memory allocation then you should instead look at sun.misc.Unsafe.
http://www.docjar.com/html/api/sun/misc/Unsafe.java.html
public native long allocateMemory(long bytes);
public native void freeMemory(long address);
Of course you still have to calculate the field offsets and all that stuff manually because it's not a part of the java language but you only asked about the JVM.Re: Eclipse OpenJ9 – Open-source JVM
#75Earlier quoted context omitted.
Why would you want to add a delete keyword? Are you trying to add explicit memory management to simplify the work of the garbage collector?
One example would be game development, where people end up doing object pooling to avoid GC pauses dropping frames.
If those 11 threads would share the same heap and 1 thread still doesn't use the gc because it's using manual memory management then you'd still suffer from stop the world pauses.
What you want is isolated heaps like erlang does, not manual memory management. I'm still wondering why we have no other programming languages with multiple heaps. You could probably achieve something similar with D and use of memory mapped files to efficiently share memory without copying bewteen processes. Alternatively you could call into C to spawn OS threads that don't suffer from stop the world pauses. But those two options are a hack. You're not supposed to use D like that.
I chose D as an example because it's a programming language with both a garbage collector and manual memory management that still suffers from stop the world pauses.
Re: Eclipse OpenJ9 – Open-source JVM
#76Earlier quoted context omitted.
There are better ways to eliminate GC pauses than manual memory management (even ignoring the relatively new "pauseless" GCs). See the new RTSJ (realtime Java) specification here: https://www.aicas.com/cms/en/rtsj . Not that it's designed for far stricter requirements than games (cases where even microseconds of unexpected latency may result in actual life safety concerns). Manual memory management is a good choice i…
The RTSJ solution is to simply pre-allocate everything you could ever want and reuse that. That’s horrible to use for game development.
Re: Eclipse OpenJ9 – Open-source JVM
#77The "Welcome to the Eclipse OpenJ9 repository" is just brilliant. So many product blogs and source code repositories fail to introduce the product first.
Re: Eclipse OpenJ9 – Open-source JVM
#78The JVM space is suddenly getting very interesting. But my question is, why now? While OMR did opened up a year ago it didn't seems to have gained any traction.
Then there was the JavaEE last week opened also going to Eclipse, which is strange because it has always been IBM going to Eclipse and Oracle goes to Apache.
Not to mention the OpenJDK builds https://blogs.oracle.com/java-platform-group/faster-and-easi...
What is going on in the Java Land? Because I dont for a moment believe these company are doing it for good of Java. At least not from IBM and Oracle.
Or am i thinking too much into it?
Re: Eclipse OpenJ9 – Open-source JVM
#79Earlier quoted context omitted.
> That's not the RTSJ solution. RTSJ uses arenas, which are great if you have regular allocation/deallocation cycles, like, say, a frame in a game. So how do I get a user’s Oracle JRE installation to use arenas? The only realistic scenario is to preallocate and reuse.
You don't. You use an RTSJ JVM.
Re: Eclipse OpenJ9 – Open-source JVM
#80I'm one of the authors behind https://www.adoptopenjdk.net (CI at ci.adoptopenjdk.net, project at github/adoptopenjdk) where we are providing nightly and release builds of OpenJ9 (as well as a host of other OpenJDK derivatives). We've recently been granted the TCK (as the London Java Community) and so you'll shortly have professionally tested 'You can call this Java' binaries.