Uploaded image for project: 'JS - JobScheduler'
  1. JS - JobScheduler
  2. JS-1108

Java Threads do not terminate on agent

    XMLWordPrintable

Details

    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.

      Attachments

        Activity

          People

            jz Joacim Zschimmer
            fs Florian Schreiber (Inactive)
            Florian Schreiber Florian Schreiber (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1 week, 2 days
                1w 2d
                Remaining:
                Remaining Estimate - 1 week, 2 days
                1w 2d
                Logged:
                Time Spent - Not Specified
                Not Specified