miho / VWorkflows

Flow Visualization Library for JavaFX and VRL-Studio
http://vworkflows.mihosoft.eu
Other
296 stars 67 forks source link

High CPU consumption with Adopt Java 15 and OpenJFX 15 #69

Closed treimers closed 3 years ago

treimers commented 4 years ago

We have been using VWorkflows for years in our application successfully. It was based on Oracle Java 1.8_202 and we started to port it to Java 15 now:

We tested the resulting software under Windows 10 and Mac OS X 10.11.6 and got a performance issue under both operating systems.

Our application started to consume CPU and memory when VWorkflow panels were opened. The more nodes a panel had the more consumption happened. This disappeared when the VWorkflow panels were closed.

Interestingly objects are allocated and deallocated periodically when VWorkflow panels are displayed. This also happens when the application is put into the background.

With profiling tool we were able to see that memory usage is increasing and decreasing continously.

Bildschirmfoto 2020-11-11 um 21 32 19

This at the end leads to higher CPU consumption as well because garbage collection is running on a regular base.

I was able to reproduce this behaviour in our environment using your VWorkflows-Demo project. The screen shot above was taken using VisualVM when the demo application was running.

I had to modfiy the VWorkflows-Demo project in order to get it running under Adopt Java 15. I added a new Launcher class and replaced the main method from Main class. I used Maven as build tool to create native applications by means of Maven plugin JavaPackager.

In order to reproduce please checkout my fork , install Adopt JDK 15 and Maven and run a Maven build on demo project by

cd VWorkflows-Demo
mvn package

Open the resulting application and monitor cpu usage with tools like "top". A constant usage by the demo application is shown. With profiling tools the heap usage can be checked as well.

treimers commented 3 years ago

This issue has been fixed with version 0.2.5.0 (Commit 75770e127aae196fd482d1b62be8f51ce234d7ac).

Thank you very much!