ObjectDB ObjectDB

Slow performance on Mac

#1

- This code is tested on Windows and Mac. Windows is working great, Mac is very slow (read is 11 seconds on Mac, and 100 milliseconds on Windows).

- Application is using Spring Boot console application (for JPA implementation)

- MacOS Sierra 10.12.3, Core i7 CPU, 16GB RAM, SSD drive
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

 

Running sample jar:

- To generate data (write):

    java -jar demo-0.0.1-SNAPSHOT.jar write /path/to/file.odb

- To read data (write):

    java -jar demo-0.0.1-SNAPSHOT.jar read /path/to/file.odb

 

Attached:

- JAR file

- Source code

- Netbeans profiler traces (seems issue in createEntityManager() performance)

edit
delete
#2

Please ignore. This was Mac / Java issue related to lookupAllHostAddr

Ref: https://thoeni.io/post/macos-sierra-java/

edit
delete
#3

Thank you very much for this post! I am on OSX 10.12.6, JVM 1.8.0_144-b01, and I was also having performance issues on one of my development machines. On one machine my test scenario would take <1s and on a machine with similar hardware it took multiple minutes.

Although it's not ObjectDB's fault, I also traced the issue down to the "createEntityManager()" method, which would take 5 seconds. Also the ObjectDB explorer behaved weirdly and would hang for ~20 seconds when opening a database file. Very weird issue and hard to debug!

Your solution works great and saved me a lot of time. Thanks!

edit
delete

Reply

To post on this website please sign in.