Hi,
We've developed a Java standalone program. We've configured in our Linux (RedHat ES 4) cron schedule to execute this Java standalone every 10 minutes. Each standalone may sometime take more than 1 hour to complete, or sometime it may complete even within 5 minutes.
My problem/solution I'm looking for is, the number of Java standalones executing at any time should not exceed, for example, 5 process. So, for example, before even a Java standalone/process starts, if there are already 5 processes running, then this process should not be started; otherwise this would indirectly start creating OutOfMemoryError problems. How do I control this? I would also like to make this 5 process limit configurable.
Other Information:
I've also configured -Xms and -Xmx heap size settings.
Is there any tool/mechanism by which we can control this?
I also heard about Java Service Wrapper. What is this all about?