I have a written a java program that uses multi-threads and prints the run-time when the processing is done.
I've created the jar file so I can test it on the university's server. Both the program in eclipse and the jar file runs perfectly on my machine (8 GB RAM and only 4 CPUs Ubuntu). But when I try to execute the jar on the server it's 2x slower! knowing that the virtual machine on the server has 8GB in RAM and 6 CPUs (Debian).
Why the jar file is slower on the virtual machine? I figured it's probably because of the JDK version on the Debian machine, so I updated JDK and JRE.
(Used Java version in Debian)
openjdk version "1.8.0_171"
OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-1~deb9u1-b11)
OpenJDK Server VM (build 25.171-b11, mixed mode)
(Java version on my "supposed-to-be-slower" Ubuntu)
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
As of Java 7 there is almost no difference between OpenJDK and Oracle HotSpot, see the Moving to OpenJDK as the official Java SE 7 Reference Implementation article.
If you want to compare execution on both Linux machines you can try profiling with Flame Graphs:
Flame graphs are a visualization of profiled software, allowing the most frequent code-paths to be identified quickly and accurately.
A good example how to use them is available on Netflix tech blog, especially the "The Problem with Profilers" section.
Related
On of our (remote) developers needs to install FDT (an Eclipse based IDE) to compile some legacy ActionScript code. I've got FDT working on my Ubuntu 18.04 laptop just fine, but the dev is having trouble getting it to work on his Mac. When he has Java version 7, 8 or 9 installed he gets a message saying
we need legacy java you can download it here...
and if he uses Java version 6, it says it needs version 7 or more.
So I checked which version I have on my Ubuntu 18.04 laptop so he can get the same one, and to my surprise it says:
$ java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
As far as I know Java is WAY ahead of version 1.8. So I logged into our production server (Ubuntu 16.04) and there we've got something similar:
$ java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-0ubuntu0.16.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
I checked out the OpenJDK website and there it says OpenJDK is now at version 11.
What version of Java my laptop is actually running so our dev can get the same version?
You are using Java 8.
The Mac problem is a historic one because the legacy question is for a 32-bit JVM for some programs and you need a 64-bit for Java 8.
Install the Java 6 the programs want and then install A newer java from oracle and he should be good to go.
I am trying to replace standard JVM of jdk1.8.0_112 with Dynamic Code Evolution VM using
DCEVM-light-8u112-installer.jar
but when i checked jvm version after patching with command
c:>java -version
it is still showing same Server VM as below
1 java version "1.8.0_112"
2 Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
3 Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
at line number 3, i am expecting type of Server VM as
Dynamic Code Evolution 64-Bit Server VM (build 25.71-b01-dcevmlight-10, mixed mode)
please guide me on this
The light version of the DCEVM project provides a single jvm.dll file that is a replacement for the default jvm.dll file included with Oracle/OpenJDK JDKs. The light version does not overwrite the file included with the JDK/JRE installation but rather installs the DCEVM JVM as an alternate implementation. Therefore, java -version will continue to show the default Java version details.
If DCEVM was installed successfully, java -version -XXaltjvm=dcevm will show the DCEVM version details, as expected.
java -version will return the DCEVM JVM version details if the full version of DCEVM is installed. Currently the DCEVM project provides full binaries only for Java 7. However, there is very little functional difference between the light and full versions so there is no real need to install the full version.
I am using rjb to connect java classes in my rails application...
But I am getting this error can't create Java VM
My ruby -v gave me
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
and java --version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.5) (7u79-2.5.5-0ubuntu0.14.04.2)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
I went through this post Error “can't create Java VM” trying to use Ruby Java Bridge (RJB) gem but the problem is I can not install 32 bit java as it is needed by some other application
I would download the jdk from oracle (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html), the version you need. Then for your application set JAVA_HOME to that install directory. You can have multiple different jvms installed on a system.
I have installed RHEL 6.5 and am facing a performance issue with java.
# time java -version
java version "1.6.0_34"
OpenJDK Runtime Environment (IcedTea6 1.13.6) (rhel-1.13.6.1.el6_6-x86_64)
OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)
real 0m45.243s
user 0m0.149s
sys 0m0.086s
Try to install version java version "1.8.0_31" and see if the numbers does improve.
rpm -ivh jdk-8u31-linux-x64.rpm
Also check the configuration page from RHEL. https://access.redhat.com/documentation/en-US/JBoss_Communications_Platform/5.0/html/Platform_Installation_Guide/chap-Installing_and_Configuring_Java.html
I found out that it was McAfee's nails process which was slowing down not only java but many other system processes. Stopping resolved the issue.
I'm running on ubuntu 12.04 and when I put in the terminal java -version I got this message:
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)
but despite that, if I put in the terminal javadoc I receive a message as it isn't installed in my machine.
The Java Runtime Environment (JRE) doesn't include javadoc. It includes only the things required to run Java programs, not to develop them.
You need the JDK (Java Development Kit) which includes developer tools like javadoc, in addition to everything found in the JRE.
See the Ubuntu Java documentation.