Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Feb 2013 10:03:23 +0200
From:      Achilleas Mantzios <achill@matrix.gatewaynet.com>
To:        freebsd-java@freebsd.org
Subject:   Re: Problem with Java System.exit on OpenJDK 7
Message-ID:  <2092461.Iuophl5C6i@smadev.internal.net>
In-Reply-To: <CABBxOKm1zMiXNrU7Nm5ObcFdGb=7KobJfiLqJ4RtzjvrQbKbXA@mail.gmail.com>
References:  <CABBxOKm1zMiXNrU7Nm5ObcFdGb=7KobJfiLqJ4RtzjvrQbKbXA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
(sorry, i am resending this from a valid From:)

some suggestions/thoughts :
- ktrace=20
- truss
- gdb against a _g version (debugging enabled) of OpenJDK 7 java (if av=
ailable)
- jdb

I doubt KDE or anything would have any relation to your problem.
It might more likely be related to libthr/libc

What version of Java do you have on Windows?
You have to realize jumping from Windows/(Oracle?)Java to FreeBSD/Openj=
dk7 makes
a huge difference.

Hmmmm this looks also like a TCP/IP timeout kind of thing... just a raw=
 speculation.
Can you try with disabling IPV6?

On =C3=8E=C2=94=C3=8E=C2=B5=C3=8F=C2=85 11 =C3=8E=C2=A6=C3=8E=C2=B5=C3=8E=
=C2=B2 2013 17:15:23 David P. Caldwell wrote:
> So I'm having a problem with the performance of a Java subprocess run=
ning
> under Java, running on 9.0-RELEASE i386.
>=20
> It's a big subprocess, difficult to decompose. It's a big parent proc=
ess,
> difficult to decompose. I'm working on it. I've nearly ruled out the =
parent
> process as the culprit (see below), but I include it for completeness=
, just
> in case there's something I'm missing.
>=20
> Everything runs as expected on Windows, which brings me here to this =
list.
>=20
> Basically, the parent process launches the subprocess using a Java co=
mmand.
> It runs. It runs fine. The *subprocess* calls System.exit(0). That's =
where
> the weirdness begins.
>=20
> System.exit(), for this program, takes about 2.6 seconds to run. And =
I
> can't figure out why. It takes 0.025 seconds on Windows.
>=20
> The program is a command shell, essentially, so having every subshell=
 add
> 2.6 seconds of unnecessary execution time really slows things down.
>=20
> 1. The application has System.runFinalizersOnExit set to false; I che=
cked
> in java.lang.Shutdown using reflection to be sure.
>=20
> 2. The application, during its shutdown, has only one shutdown hook t=
o run
> -- the application shutdown hooks hook. That application shutdown hoo=
ks
> hook has one hook, registered by me, which prints the timestamp (for =
trying
> to debug this), only. Something takes 2.6 seconds to end the VM after=
 this.
>=20
> 3. There are no temporary files to delete; I checked in
> java.io.DeleteFilesOnExit using reflection to make sure. The system
> registered shutdown hook in the slot for DeleteFilesOnExit is null.
>=20
> The problem appears to have nothing to do with the parent process. I
> synthesized a giant command line command using the environment variab=
les
> and system properties under which the subprocess is running, and ran =
it
> from the bash prompt, and still got the 2.6 second delay, based on ru=
nning
> the program inside a bash wrapper that first ran the subprocess giant=

> command, then printed the system time. I'm 99.9% ready to rule it out=
 based
> on that.
>=20
> During one experiment, when running the program twice on the same com=
mand
> line, one of the runs, using the same command line, actually complete=
d
> System.exit in a time I'd expect -- about 0.03 seconds. The other too=
k
> about 2.6 seconds. All subsequent runs have take about two-and-a-half=

> seconds after the shutdown hooks; I haven't been able to reproduce th=
e
> success and I am quite sure I didn't change anything.
>=20
> I'm running this in a graphical terminal on KDE; haven't tried from a=
n
> ordinary console (obviously I am gradually broadening the things I'm =
doing,
> so I'll probably get to that). The program is not graphical and prese=
nts no
> GUI.
>=20
> The application does reference the standard input stream but the part=
icular
> program I was running consumes no input. It references stdout and std=
err as
> well, and is emitting output to those consoles.
>=20
> Does anyone have any idea or suggestions about where I should be look=
ing at
> this point? Obviously it's hard to instrument the program further on
> FreeBSD -- I assume the NetBeans Profiler / jvisualvm stuff does not =
work
> on FreeBSD; that's the last I heard.
> _______________________________________________
> freebsd-java@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-java
> To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.or=
g"
-
Achilleas Mantzios
IT DEV
IT DEPT
Dynacom Tankers Mgmt



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2092461.Iuophl5C6i>