Skip to main content

Posts

Showing posts with the label JVM

Multiple Java engines spotted with OpenJDK 7

With Oracle JDK 7, I see the usual VM options for 32 or 64-bit and -server to specify the server class JVM. With OpenJDK 7, I found it interesting to see quite a few more JVM options: Wikipedia: List of Java virtual machines Wikipedia: JamVM

Charles Oliver Nutter - Fast as C: How to write really terrible Java

Charles Oliver Nutter - Fast as C: How to write really terrible Java In this talk, we’ll explore the main reasons why Java code rarely runs as fast as C or C++ and how you can write really bad Java code that the JVM will do a better job of optimizing. We’ll take some popular microbenchmarks and burn them to the ground, monitoring JIT logs and assembly dumps along the way. vimeo Java talk video

Verbose class loading

At work, a couple of long time experience Java devs were having build issues. They didn't know where their build system was pulling in a class from. They didn't know that the JVM has a verbose class loading option. If you run java -h, you will see this in the output:     -verbose:[class|gc|jni]                  enable verbose output If you invoke your JVM like this: java -verbose:class myHelloWorld then the output will be very verbose as the class loader prints out detailed of all the classes loaded during startup and during the finding and running of your class. e.g. [Loaded java.net.URLConnection from /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar] [Loaded sun.net.www.URLConnection from /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar] [Loaded sun.net.www.protocol.file.FileURLConnection from /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar] [Loaded sun.net.www.MessageHeader from /usr/lib/jvm/j...

The OpenJDK9 Revised Java Memory Model

It can be helpful to consider the Java Memory Model when thinking about multithreading. It is being refreshed for Java 9: The OpenJDK Revised Java Memory Model JSR 133 https://jcp.org/en/jsr/detail?id=133 JSR 133 Cookbook Wikipedia: Java memory model

Need a Java refresher?

It's amazing to hear that Java is 20 years old already. If you used it and took a break and now want to get back into Java again, the following link could help as a learning refresher: JavaWorld: Learn Java from the ground up Java 20th anniversary #Java20 Update Your Skills for the 20 Years of Java

The Java Memory Model

The Java Memory Model JLS: Threads and Lock http://en.wikipedia.org/wiki/Java_Memory_Model Java theory and practice: Fixing the Java Memory Model, Part 1 http://www.javaworld.com/article/2092274/java-platform/fixing-the-java-memory-model.html