Hi Manjunath, There could be a bug somewhere in the process API. Could you try using ProcessBuilder API to execute linux-command directly and use the API to setup stdin/out/err redirects instead of using a shell script. Just to see if you get the same slowdown in that case.
Regards, Peter On Sep 20, 2016 03:54, "Manjunath SV" <manju.j...@gmail.com> wrote: > Hi, > > Virtual size is always constant - 12.6gb, no longer pauses in GC logs. > > VM will not fail if we run for loner time. > > > We submit 400+ jobs(3-4 times per day) to thread pool of size 30, each > thread has to execute more than 13+ jobs, initially threads starts sub > process in milli seconds, some times after executing 6 or 7 jobs threads > take more time to create a sub process, some times threads always take > (For 13+ jobs) milli secs to create a sub process. > > Thanks & Regards, > Manjunath > > From: <e...@zusammenkunft.net> > Date: 16 Sep 2016 12:03 p.m. > Subject: Re: Reg - Sub Process creation from java takes more time > To: "Manjunath SV" <manju.j...@gmail.com>, "core-libs-dev@openjdk.java.net > " > <core-libs-dev@openjdk.java.net> > Cc: > > Hello, > > Does the (virtual) size increase over time when it gets slower? How does > the GC log looks like, any increasing activity or longer pauses? > > If you let this VM run for longer time (when it slows down), will it > eventually fail because of some resource exhaustion? > > How often does the execute work fast, after what numberbof executions and > what runtime it gets slower? > > You can also strace the process to see if the execution time of fork() and > exec() syscalls increase. > > Gruss > Bernd > -- > Von: Manjunath SV > Gesendet: Freitag, 16. September 2016 08:19 > An: core-libs-dev@openjdk.java.net > Betreff: Reg - Sub Process creation from java takes more time > > Hi, > > I monitored memory usage, below are the details. > > Heap usage :- 857mb > Virtual memory:- 12.6gb > -Xmx set to 4gb. > > I have taken virtual and heap memory usage when Java spawns sub processes. > > Sub processes have short life, will be done in milli seconds. > > > Thanks & Regards, > Manjunath > > > Date: Thu, 15 Sep 2016 11:01:01 +0200 > From: <e...@zusammenkunft.net> > To: "core-libs-dev@openjdk.java.net" <core-libs-dev@openjdk.java.net> > Subject: Re: Reg - Sub Process creation from java takes more time > Message-ID: <57da634c.c336c20a.19b0c.b...@mx.google.com> > Content-Type: text/plain; charset="utf-8" > > Hello, > > Do you monitor heap usage and virtual memory size of your Java process? I > would look out for increase (which causes slower for tines). > > Also it is generally a good idea to turn on GC logging and look into it if > a java process degregades over time > > Gruss > Bernd > > Just BTW: I think Java would not be the right tool to spawn and control > sich a high number of external processes. Maybe it would be better to hand > that off to a more native component. > -- > http://bernd.eckenfels.net > > Von: Manjunath SV > > Hi All, > > I am Manjunath, We are facing below issue in Java application. > > Issue Details :- > > Java application has a thread pool of size 30, When it receives Job message > from JMS, It creates around 200+ jobs and submit into thread > pool,initially 30 threads creates shell script process very quick, later > process creation time gradually increases (5-9 mins). > > > Java application invokes shell script, Below is the code. > > process = Runtime.getRuntime().exec(new String[] { script_name, > param1, param2, param3,param4 }); > > int response = process.waitFor(); > > Shell script :- > > #!/bin/ksh > linux-command -un $1 -pw $2 -f batch.txt < $3 > $4 2>&1 > > We redirected command output and errors to a file. > > First job execution after application restart takes just 15 sec, later job > execution takes around 15 mins, some times 40 mins also. > > We are using java 1.8.0_92. > > Please advise on this. > > Thanks in advance. > > Regards, > Manjunath >