karakun / OpenWebStart

Run Web Start based applications after the release of Java 11
https://openwebstart.com
Other
420 stars 48 forks source link

Excessive memory/CPU consumption if Log to file is enabled #157

Closed pkeusem closed 4 years ago

pkeusem commented 4 years ago

If the Log to file setting in the Logging tab of the OpenWebStart 1.1.1 settings applet is enabled, we are seeing excessive memory and eventually CPU consumption by the javaws process. Disabling the Log to file setting resolves the problem.

sclassen commented 4 years ago

we currently have not seen this behavior ourselves. would it be possible to share an application/jnlp which can reproduce the high mem/cpu load. This would help us fixing the problem.

undergraver commented 4 years ago

This issue looks related to #225 if not the same.

AndreasEhret commented 4 years ago

Test with current release 1.1.7

pkeusem commented 4 years ago

I have installed 1.1.7 and now the application won't run.  It starts up to the point where the app window is created then exits.

I was able to confirm the original behavior by reinstalling 1.1.6.  Running on OpenWebStart 1.1.6, the application will start and run but the javaws process continues to run after the application is closed and consumes all available memory if logging to a file is enabled.

Running on 1.1.7, the application begins to start but exits immediately after drawing the application main window.

Paul

On 2020-04-09 09:43, Andreas Ehret wrote:

Closed #157 https://github.com/karakun/OpenWebStart/issues/157.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/karakun/OpenWebStart/issues/157#event-3218611781, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADJENIFZM4JW4WBG3QSG6T3RLXNHVANCNFSM4KGEYBMQ.

-- Paul Keusemann pkeusem@gmail.com 4266 Joppa Court (952) 894-7805 Savage, MN 55378

sclassen commented 4 years ago

Can you please post the logs from 1.1.7

pkeusem commented 4 years ago

On 2020-04-09 16:49, sclassen wrote:

Can you please post the logs from 1.1.7

I think this is what you are looking for. If not, let me know.

This is from a run with debug logging activated, logging to stdout and to file enabled but none of those setting seem to make any difference.  Also, the console disappears before I can get a look at it.

Paul

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/karakun/OpenWebStart/issues/157#issuecomment-611769439, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADJENIE5WQCVI6KDNGXAGP3RLY7GZANCNFSM4KGEYBMQ.

-- Paul Keusemann pkeusem@gmail.com 4266 Joppa Court (952) 894-7805 Savage, MN 55378

sclassen commented 4 years ago

Sorry, i cannot see any logs attached to your message

pkeusem commented 4 years ago

Trying this again...

On 2020-04-10 09:30, sclassen wrote:

Sorry, i cannot see any logs attached to your message

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/karakun/OpenWebStart/issues/157#issuecomment-612053826, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADJENIHEEIS5R6WKC5LS5IDRL4UPXANCNFSM4KGEYBMQ.

-- Paul Keusemann pkeusem@gmail.com 4266 Joppa Court (952) 894-7805 Savage, MN 55378

sclassen commented 4 years ago

I think you need to attach the log in the web UI of github

pkeusem commented 4 years ago

Here you go:

itw-clienta-2020-04-10_07_21_33.196.log itw-javantx-2020-04-10_07_21_27.142.log

pkeusem commented 4 years ago

Closed by mistake.

sclassen commented 4 years ago

is your JNLP an application or an applet? Could you please share your JNLP for further debugging

pkeusem commented 4 years ago

I have tried it both ways, I believe the first set of logs is from running as an applet.

When run as an applet (I know this is not supported), the empty frame is painted then it exits. HTML, JNLP and logs follow here:

HOSTSIM-applet-jnlp.htm.txt HOSTSIM-applet.jnlp.txt itw-clienta-2020-04-13_17_33_59.239.log itw-javantx-2020-04-13_17_33_53.428.log

pkeusem commented 4 years ago

When run as an application, the OWS console starts (OWS-Console.txt below) but the application never does. It just seems to hang after starting the console.

Here are the HTML, JNLP and logs when run as an application: HOSTSIM-applet-jnlp.htm.txt HOSTSIM-application.jnlp.txt OWS-Console.txt itw-clienta-2020-04-13_17_38_48.401.log itw-javantx-2020-04-13_17_38_43.656.log

mvw commented 4 years ago

We have the same behaviour for applets since 1.1.7. Window opens shortly, displays only a white background nothing else, then quits. The port to Swing application seems to work. (see also my comment https://github.com/karakun/OpenWebStart/issues/239#issuecomment-618647625)

pkeusem commented 4 years ago

I have a simple command line example applet/application that just pops up a gui and lists the various arguments, parameters and properties passed to it. This example works as an applet and as an application when run with Oracle Java 8 javaws. If I try to run it with the OpenWebStart 1.1.7 javaws, the splash screen is displayed, followed by the console window then it exits with the following error message:

net.sourceforge.jnlp.LaunchException: Invalid jnlp file \javaws

I have validated the JNLP files with xmlproc_parse and Roedy Green's ValidateJNLP app.

The owsRun batch file is used to locate the desired javaws and is run with following command lines:

    owsRun -verbose JSPTest.jnlp > javaws-JSPTest.log 2>&1
    owsRun -verbose JSPAppletTest.jnlp > javaws-JSPAppletTest.log 2>&1

I am including a zip file:

OWSExample.zip

which contains the batch file, applet and application JNLP files and associated jar files and logs.

Any help in debugging this would be greatly appreciated.

sclassen commented 4 years ago

OK, how exactly are you launching OpenWebStart? The very first line states the you pass the following arguments: [\javaws, -verbose, JSPTest.jnlp] ITW will take the first argument it does not know and assumes that it is the JNLP file. In your case it takes \javaws and tries to open it as a file. Which than later on fails.

Correct would be to only pass JSPTest.jnlp.

-verbose is currently the default and does not need to be specified on the command line.

pkeusem commented 4 years ago

I am using the included batch file to launch javaws with the command lines mentioned above, included here again:

owsRun -verbose JSPTest.jnlp > javaws-JSPTest.log 2>&1
owsRun -verbose JSPAppletTest.jnlp > javaws-JSPAppletTest.log 2>&1

The results are the same without the -verbose option. I am definitely NOT passing \javaws on the command line or in the batch batch file.

sclassen commented 4 years ago

Sorry, I am not using Windows and cannot run your batch file.

sclassen commented 4 years ago

@janakmulani can you help with the batch script?

pkeusem commented 4 years ago

On 2020-04-27 00:34, sclassen wrote:

Sorry, I am not using Windows and cannot run your batch file.

I wish I had that luxury. :-)

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/karakun/OpenWebStart/issues/157#issuecomment-619732615, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADJENIF2JA2PEPEKNVUCZF3ROUKOPANCNFSM4KGEYBMQ.

-- Paul Keusemann pkeusem@gmail.com 4266 Joppa Court (952) 894-7805 Savage, MN 55378

pkeusem commented 4 years ago

On 2020-04-27 00:36, sclassen wrote:

@janakmulani https://github.com/janakmulani can you help with the batch script?

Hopefully I can help clear up the Windows brain damage:

The location of the JDK is assigned to the environment variable jdkHome.  That is where I have Open Web Start installed on this PC.  The jdkHome variable is then used to assign the path to javaws to the javaws environment variable.

The batch file takes up to 9 arguments (%1 ... %9) and passes them to to javaws (%javaws%).

As mentioned before, I run the batch file with the following command line:

owsRun -verbose JSPTest.jnlp > javaws-JSPTest.log 2>&1
owsRun -verbose JSPAppletTest.jnlp > javaws-JSPAppletTest.log 2>&1

I have also tried running without the -verbose option with no change in behavior.

Paul

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/karakun/OpenWebStart/issues/157#issuecomment-619733301, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADJENIAT4JQ6MTA7NXRSGJTROUKUZANCNFSM4KGEYBMQ.

-- Paul Keusemann pkeusem@gmail.com 4266 Joppa Court (952) 894-7805 Savage, MN 55378

pkeusem commented 4 years ago

I installed the Linux version of Open Web Start on my Linux machine and ran the test there and except for the file name, the error appears to be the same. The stack traces match.

I am attaching the log (JSPTest-linux.log) and shell script (owsRun). Here is the command line:

./owsRun JSPTest.jnlp > JSPTest-linux.log 2>&1

I am also attaching the corresponding log from Windows (JSPTest-win.log).

Paul

owsRun.txt JSPTest-linux.log JSPTest-win.log

janakmulani commented 4 years ago

@sclassen

@janakmulani can you help with the batch script?

Sorry but where is the batch script owsRun located? Is it part of OWS installation?

pkeusem commented 4 years ago

On 2020-04-27 14:02, janakmulani wrote:

@janakmulani <https://github.com/janakmulani> can you help with
the batch script?

Sorry but where is the batch script owsRun located? Is it part of OWS installation?

No.  It's something I wrote so I could easily test with IcedTea-Web, Open Web Start and Oracle implementations of Java Web Start  from the command line.

The batch file is in the OWSExample.zip zip-file attached in a previous comment but here it is:

@echo off
REM
REM Run the Open Web Start javaws with arguments.
REM

set jdkHome="C:\Program Files\OpenWebStart"
set javaws=%jdkHome%\javaws

%javaws% %1 %2 %3 %4 %5 %6 %7 %8 %9

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/karakun/OpenWebStart/issues/157#issuecomment-620172815, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADJENIBVBRTFJKKFPHYEGP3ROXJC5ANCNFSM4KGEYBMQ.

-- Paul Keusemann pkeusem@gmail.com 4266 Joppa Court (952) 894-7805 Savage, MN 55378

mvw commented 4 years ago

It seems your jdkHome env var is empty. The usual ones are JAVA_HOME and JDK_HOME.

pkeusem commented 4 years ago

In the batch file, jdkHome is set to "C:\Program Files\OpenWebStart". If it was unset, javaws would not run at all.

I believe the "\javaws" in the error message is a bug in the Windows implementation of javaws. I am getting the same stack trace when I try to run the JNLP file on Linux but there the error message is "Invalid jnlp file JSPTest.jnlp".

Paul

sclassen commented 4 years ago

The linux log shows that OWS failed to find the file on the filesystem. But unfortunately it does not log the absolute path. Therefore I cannot tell in which directory it is looking. I improved the logging so it will log the absolute path in the future

pkeusem commented 4 years ago

The linux log shows that OWS failed to find the file on the filesystem. But unfortunately it does not log the absolute path. Therefore I cannot tell in which directory it is looking. I improved the logging so it will log the absolute path in the future

This was actually helpful. If I specify an absolute path to the JNLP file, it runs on Linux.

On Windows, running my batch file with an absolute path still failed with the same error message as before as did running it directly from the command line as follows:

H:\JIS922\Hostsim\webapps\jsptest>"C:\Program Files\OpenWebStart"\javaws H:\JIS922\Hostsim\webapps\jsptest\JSPTest.jnlp

but changing the command line so the full path to the executable is quoted works:

H:\JIS922\Hostsim\webapps\jsptest>"C:\Program Files\OpenWebStart\javaws" H:\JIS922\Hostsim\webapps\jsptest\JSPTest.jnlp

I would attribute this to Windows command shell quoting brain damage but the command shell is finding and executing javaws. So, it seems the quoting of the path to the javaws executable is affecting how javaws parses the command line arguments on Windows.

Now I can get back to debugging my original application which is still hanging.

janakmulani commented 4 years ago

Hi,

I deployed the jnlp files JSPTest.jnlp and JSPTestApplet.jnlp and corresponding jars in a server.

I run the jnlp apps like this:

owsRun http://localhost:8080/jnlp/JSPTestApplet.jnlp owsRun http://localhost:8080/jnlp/JSPTest.jnlp

owsRun looks like this:

set jdkHome="c:\Program Files\Java\jdk1.8.0_172" set jwsHome=c:\OpenWebStart set javaws=%jwsHome%\javaws set JAVA_HOME=%jdkHome% echo "Running: %javaws% %1 %javaws% %1

Result: For JSPTest see the screenshot: JSPTest

For JSPTestApplet: The app starts the splash comes and closes. No errors in OWS logs. In the app log I have: [MESSAGE_ALL][Tue Apr 28 22:19:31 IST 2020] Props count: 5 jnlp.QUERYSTR: "http://localhost:8080/jnlp/JSPTestApplet.jnlp?param1=value1;param2=value2;param3=value3;" jnlp.param4: "value4" jnlp.param3: "value3" jnlp.param2: "value2" jnlp.param1: "value1"

In your log file you have the error: [paulkeus][ITW-JAVAWS][ERROR_ALL][Mon Apr 27 08:39:47 CDT 2020][net.sourceforge.jnlp.runtime.Boot] NETX Thread# 6bf2d08e, name main failed to launch net.sourceforge.jnlp.LaunchException: Invalid jnlp file \javaws

It means somewhere in your owsRun args are mixed up : "javaws" is being passed as jnlp file to OWS javaws.exe instead of a real jnlp file.

pkeusem commented 4 years ago

Nope. See my previous comment.

There were two problems:

If I run the following command (embedded quote in executable path):

"C:\Program Files\OpenWebStart"\javaws JSPTest.jnlp

I get the following error message for the LaunchException:

net.sourceforge.jnlp.LaunchException: Invalid jnlp file \javaws

If I run the following command (entire executable path quoted):

"C:\Program Files\OpenWebStart\javaws" JSPTest.jnlp

I get the following error message for the LaunchException:

net.sourceforge.jnlp.LaunchException: Invalid jnlp file JSPTest.jnlp

Note: The only change is in the quoting of the executable path. The javaws executable runs in both cases but gives the wrong filename for the JNLP file in the first case. It fails to run the Java app in both cases.

If I run the following command (entire executable path quoted and absolute path to the JNLP file):

"C:\Program Files\OpenWebStart\javaws" H:\JIS922\Hostsim\webapps\jsptest\tmp\JSPTest.jnlp

The Java app runs as expected.

Note: The quoting brain damage only occurs on Windows. The absolute path for the JNLP file is required on both Windows and Unix.

sclassen commented 4 years ago

We found a possible cause of this and will release a fix early August

janakmulani commented 4 years ago

@pkeusem Please try OWS1.2.0 to be released next week and let us know.

Jamila891 commented 4 years ago

@pkeusem new version 1.2.0 has been released. Please try it.

Jamila891 commented 4 years ago

closed due to inactivity