Java Performance on Macbook Pro (not GUI) - java

I have some Java code to fetch data from SQLite and do some linguistic processing (lemmatization) with the data and write the modified data into another SQLite datebase. The database tables have indexes, so the query should be fast although the data is joined.
The small program shall produce a database being used in an iPhone app.
On my Ubuntu PC (14.04.3 LTS) this program runs fast, but on my Macbook Pro (OS X El Capitan 10.11) it runs 10 or more times slower.
java -version on Ubuntu PC:
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
java -version on Macbook:
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
I also pointed eclipse to jdk 7 in Java->Installed JREs to have the same version as on the Ubuntu PC
The java command generated by eclipse is the same on both machines:
/path/to/jdk7/java -Dfile.encoding=UTF-8 -classpath
... many jars ...
my.package.myclass
How to get the same speed on the Macbook? Is the java implementation just not that fast under Mac OS?

Related

Check the if version of JDK installed on macOS is the correct one

I have a macbook with latest HighSierra installed and from System Preferences / Java Panel. It says that i have got latest Java version installed: java 8 update 181.
From the "Java" tab of the aforementioned "Java settings" dialog i can see that the version 181 it is referring to is installed in /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
If i try to execute that binary (i.e. java -version) i actually get:
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build
1.8.0_181-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
however when i try to launch "java" from a generic prompt or if i try to execute javac i get a different result:
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
this latter java is installed in /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/
So it seems to me that i have got a jre (181) and a jdk (40) is this correct?
if so, is this the correct setup on mac? i started to wonder when forticlient analyzer showed up a bunch of CVE security issues related to JDK that are fixed in update 181.

Unexplainable differences between Java on OSX and Blade VPS

I'm developing a Tomcat Web Application. I'm using apache-tomcat-9.0.10 on both my development machine (Mac OS High Sierra) and my Blade VPS (Debian 8.1). Both give the following output on java -version:
Local:
java version "10.0.1" 2018-04-17 Java(TM) SE Runtime Environment 18.3
(build 10.0.1+10) Java HotSpot(TM) 64-Bit Server VM 18.3 (build
10.0.1+10, mixed mode) Evert-Jans-MacBook-Pro:apache-tomcat-9.0.10
Remote:
java version "10.0.1" 2018-04-17 Java(TM) SE Runtime Environment 18.3
(build 10.0.1+10) Java HotSpot(TM) 64-Bit Server VM 18.3 (build
10.0.1+10, mixed mode)
The Java settings are equal on both my Local machine and the remote VPS.
Yet, Locally it works but the remote server gives a 'page can’t be found error'.
Any ideas? Please let me know.
I solved the issue. I didn't upload the Lucene index which the app expected under/usr/local/index/.
Apache Tomcat could have given a more descriptive error than 404, which caused me to go and seek in the wrong direction.

Why does my uberjar not work on Windows 7?

I created a new project using Clojure by doing this on a Mac:
lein new app clojure-noob
Created my uberjar using
lein uberjar
Sure enough, I can run this uberjar via:
java -jar target/uberjar/clojure-noob-0.1.0-SNAPSHOT-standalone.jar
And I get:
Hello, World!
Now I take this file to Windows 7 and give the same command:
java -jar clojure-noob-0.1.0-SNAPSHOT-standalone.jar
I seem to get an infinite wait. Why can’t I get to runt his .jar file on Windows?
The java version on Mac is:
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
The java version on Windows 7 is:
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b18)
Java HotSpot(TM) Client VM (build 25.66-b18, mixed mode)
lein version gives the following: Leiningen 2.5.3 on Java 1.8.0_51 Java HotSpot(TM) 64-Bit Server VM
The answer is that I was trying to run the .jar from shared folders on a Windows 7 VM from VirtualBox running on a Mac. This IO is very slow.
When I just copy that file to, say, Desktop and run from there - the access is quiet fast. Thanks SubOptimal for helping me figure this out.

What are the supported Java FX Mouse events on ARM Architecture?

I have compiled a Java FX application on windows platform using e(fx)clipse build
JDK version on Windows:
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
I need to deploy the same application on Raspberry Pi. It sports an ARM v6 Architecture.
I am using 2014-12-24-wheezy-raspbian disribution with 256/256MB Memory split.
Java build tested on the platform:
Default package:
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode)
Java SE Embedded
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode)
Issues Facing:
Java FX runs in Full Screen Mode with blocking all the other displays
Mouse.Drag events don't work.
Dialog, blocks the application.
Windows close,minimize options are not visible/disabled
Solutions tried
Changed the Memory split
Result: Nicer FX Graphics
Added dwg_ota.speed=1 (Changes USB bus speed from 480Mb/s to 12Mb/s)
Result: No Change
Is there any way where in I can get Mouse Drag events to work? Please do suggest. Where should I report the above bugs regarding Java FX on ARM Platform?

java SE 6 (1.6.0_29-b11-402) and SE 7 (1.7.0-ea-b218) extremely slow under os x lion (i7 2,5 GHz)

I am struggling with a vanilla install of java SE6 (Java for OS X Lion Update 1). It just takes ages to load even for simple and repeated output of its version.
$ time java -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
real 0m5.129s
user 0m0.063s
sys 0m0.018s
Using OpenJDK 7 does not improve the situation:
$ time java -version
openjdk version "1.7.0-ea"
OpenJDK Runtime Environment (build 1.7.0-ea-b218)
OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode)
real 0m5.928s
user 0m0.054s
sys 0m0.015s
I am running OS X Lion, MBP 2,5 GHz quad i7, 8GB RAM, SSD. Speed is not an issue in other regions of the system (OS, Interface, Media, Ruby), so I am not thinking about a general hardware defect.
Has somebody encountered similar issues or knows anything I could check / try / verify?
I am grateful for any advice!

Categories