B4J Question JAR startup slowly

carycai

Member
Licensed User
Longtime User
I write a B4J UI program running in Raspberry pi,use the command: java -jar xx.jar.It takes about 10 seconds to startup completely.It is too slowly.Is there any solution?
Ps:the same program run in windows just need 1 second to show the UI.
 

carycai

Member
Licensed User
Longtime User

Attachments

  • 1.png
    1.png
    5.6 KB · Views: 107
Upvote 0

tchart

Well-Known Member
Licensed User
Longtime User
What JRE/JDK are you using on each system?

I noticed on another application I adminster (not a B4X application) slowed down considerably when the vendor switched from Oracle JDK to Open JDK.

Also, why dont you add some logging to see what is taking so long during start up.

I'm surprised you get 1 second launch times. I have a new laptop (32gb RAM, Ryzen 5, SSD, 1060 GTX) and any B4X UI app I launch takes around 3-5 seconds.
 
Upvote 0

carycai

Member
Licensed User
Longtime User
JDK:
openjdk 11.0.1-BellSoft 2018-10-16
OpenJDK Runtime Environment (build 11.0.1-BellSoft+0)
OpenJDK Server VM (build 11.0.1-BellSoft+0, mixed mode)

Loading log -> attach file(two files);
 

Attachments

  • log1.txt
    219.6 KB · Views: 109
  • log2.txt
    455.8 KB · Views: 126
Upvote 0

tchart

Well-Known Member
Licensed User
Longtime User
@carycai have you manually timed it with all logging turned off?

I have also experienced slow start ups with some app if you are writing to disk - for example I had a web app on Azure App Service which has very slow disk read/write, when Imoved it to another Linux host it was very fast. I bring this up since your Pi is most likley writing to an SD card which is not as fast as true disk.
 
Upvote 0
Top