Reg - Sub Process creation from java takes more time

Manjunath SV manju.jccs at
Tue Sep 20 10:53:39 UTC 2016


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,

From: <ecki at>
Date: 16 Sep 2016 12:03 p.m.
Subject: Re: Reg - Sub Process creation from java takes more time
To: "Manjunath SV" <manju.jccs at>, "core-libs-dev at"
<core-libs-dev at>


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.

Von: Manjunath SV
Gesendet: Freitag, 16. September 2016 08:19
An: core-libs-dev at
Betreff: Reg - Sub Process creation from java takes more time


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,

Date: Thu, 15 Sep 2016 11:01:01 +0200
From: <ecki at>
To: "core-libs-dev at" <core-libs-dev at>
Subject: Re: Reg - Sub Process creation from java takes more time
Message-ID: <57da634c.c336c20a.19b0c.bec8 at>
Content-Type: text/plain; charset="utf-8"


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


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.

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 :-

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.


More information about the core-libs-dev mailing list