-1

I've made several java software's using hibernate + Mysql/Sqlite and I have noticed a significant difference in fetch time (from database) when using both launchers.

When I start my application using java.exe, of course a console is displayed but the application is faster than when I use javaw.exe .

My application is a windows based application, and I don't want java.exe to load the console when the application starts, so I've been using javaw.exe, but it lacks in fetch time.

What's the explanation of that issue? And how can I either start my application using java.exe without starting a console, Or start it using javaw.exe and have the same performances?

Thanks in advance.

Mssm
  • 717
  • 11
  • 29
  • 2
    Define "faster" and have you tried attaching a profiler? – fl0w Sep 17 '18 at 09:31
  • java.exe is faster in the way that for example loads all my " Product " entity and displays it into a TableView (javafx) waaay quicker than using javaw.exe... eventhought it's the same program ... I don't know what is a profiler... – Mssm Sep 17 '18 at 18:33
  • 1
    I googled the profiler for you. https://wiki.ephesoft.com/how-to-use-jvisualvm – fl0w Sep 18 '18 at 07:02
  • Have tried JVisualVM once with launching my app using javaw.exe and another time using java.exe and noticed those bugs: In java.exe works fine, but for javaw.exe, 1- CPU Monitoring says **Not supported for this JVM**, 2- Profiling process doesn't work for any of CPU, Memory, JDBC...3- Thread dump says: **Take Thread Dump failed** ... anyways seems like javaw.exe is corrupted .. any clue ? – Mssm Sep 18 '18 at 11:36
  • check this thread: https://stackoverflow.com/questions/6105844/visualvm-not-supported-for-this-jvm-on-all-local-applications - and check if your problem might entirely be caused by running 64 vs 32 bit jvms . – fl0w Sep 18 '18 at 11:58
  • Problem sovled and posted the answer, but still don't know why in java.exe , those logging instructions were not executed , eventhought it's the same program o.O – Mssm Sep 18 '18 at 13:30

1 Answers1

1

Found the problem using VisualVM (profiler). Found out that there was logging instructions which were taking much time. Removed all logs as below:

LogManager.getLogManager().getLogger("").setLevel(Level.OFF);

Thanks to fl0w.

Mssm
  • 717
  • 11
  • 29