Details
-
Fix
-
Status: Released (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
When shell-jobs are executed on an agent the used memory in Java-heap-space is growing continuously on that agent.
After a while the following error occurs and the agent crashes:
Com_set_error("Z-JAVA-105 Java exception java.lang.OutOfMemoryError("Java heap space"), method=CallObjectMethodA []","Remote_module_instance_server::construct)
This happens because the job invoking Threads an the agent do not terminate.
Workaround:
Add a monitor script to your job:
<monitor>
<!-- dummy script: workaround for jira-issue http://www.sos-berlin.com/jira/browse/JS-1108 -->
<script language="javax.script:rhino"><![CDATA[function spooler_task_after(){}]]></script>
</monitor>
Explanation of the workaround:
Although a shell-job in the JobScheduler is not a Java-program it always requires a Java-thread in addition to the shell-process.
If the shell job runs without a monitor the shell-job is started in a System-thread and uses the JVM of the JobScheduler.
This JVM is running as long the JobScheduler is running. Too many shell-jobs (without monitor) result in an overload of the main-JVM by not terminating Java-Threads.
If a monitor-script is used another JVM is started in a separate process. The shell process is started by this separate process.
That process is terminated if the task has ended so no Java-Threads can be accumulated.