Need help with Java ProcessBuilder performance on Solaris

My question is, does the JVM support some kind of resource related to threading or processes that can lead to a fast increase in ProcessBuilder performance after a month or more of regular use? Using java 6 update 21 for all applications.

Over the past few months, we noticed that one server in our data center (Sparc M4000 running on Solaris 10) can run for about 6-8 weeks without any problems. However, fast performance in an application that uses the ProcessBuilder class to run scripts is a huge success - with ProcessBuilder.start it takes more than a minute to sometimes return. After a reboot and within a few weeks thereafter, the normal return time is in the range of 10 to 100 milliseconds.

I wrote a separate small application that creates 5 threads, and each thread runs the ls command using ProcessBuilder 10 times in a row, then I collect statistics to track the original problem. This application exits after each run and runs from cron only once per hour. It usually takes just a second or two.

Last night, ProcessBuilder again increased to a minute for each call to ProcessBuilder.start after 45 days of uptime and normal behavior.

top does not display memory or processors. I tried to make jstack in a test application, but got the error "Could not create thread_db agent".

Any ideas?

+4
source share
1 answer

We had a similar problem in our application, which runs on Linux. The Linux JVM code uses a fork, which means that the address space is displayed and copied every time it executes. We performed many small short-lived processes. It seems that the main difference from your application is that we had a relatively large heap (about 240 GB), so I’m sure it affected. As a result, we created our own spawning code using JNI and posix spawn. Here is the question / answer link: Slowing down the creation process in java

+4
source

Source: https://habr.com/ru/post/1337367/


All Articles