UIMA
  1. UIMA
  2. UIMA-1938

Modify UIMA AS Primitive Service to optionally dump JVM stack if process() method takes too long

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.1AS
    • Component/s: Async Scaleout
    • Labels:
      None

      Description

      Add instrumentation to the UIMA AS Primitive service that will force JVM Stack dump if AE takes too long to process a CAS. Enable the instrumentation via -D variable. This enhancement may prove useful when debugging user code.

        Activity

        Hide
        Jerry Cwiklik added a comment -

        Modified Primitive Controller to optionally dump a JVM stack if AE takes too long to process a CAS. The instrumentation is enabled via -DdumpHeapThreshold=XX where XX is a max number of SECONDS the AE process method is allowed to process a CAS. Actually, the new instrumentation times three methods:

        CasIterator casIterator = ae.processAndOutputNewCASes(aCAS);
        casIterator.hasNext()
        CAS casProduced = casIterator.next();

        If the instrumentation is enabled and the timer pops and the JVM is forced to dump a stack. This instrumentation only works with IBM JVM which includes com.ibm.jvm.Dump class which enables stack dump via a static method JavaDump(). When running in Sun's JVM, the instrumentation is not enabled. The code uses reflection :
        Class<?> dumpClass = Class.forName("com.ibm.jvm.Dump"); to determine if it is running in IBMs jvm.

        Show
        Jerry Cwiklik added a comment - Modified Primitive Controller to optionally dump a JVM stack if AE takes too long to process a CAS. The instrumentation is enabled via -DdumpHeapThreshold=XX where XX is a max number of SECONDS the AE process method is allowed to process a CAS. Actually, the new instrumentation times three methods: CasIterator casIterator = ae.processAndOutputNewCASes(aCAS); casIterator.hasNext() CAS casProduced = casIterator.next(); If the instrumentation is enabled and the timer pops and the JVM is forced to dump a stack. This instrumentation only works with IBM JVM which includes com.ibm.jvm.Dump class which enables stack dump via a static method JavaDump(). When running in Sun's JVM, the instrumentation is not enabled. The code uses reflection : Class<?> dumpClass = Class.forName("com.ibm.jvm.Dump"); to determine if it is running in IBMs jvm.
        Hide
        Marshall Schor added a comment -

        When running Java 6, using http://download.oracle.com/javase/6/docs/api/java/lang/management/ThreadMXBean.html might be more "portable" and could also be used to find deadlocks, I think.

        Show
        Marshall Schor added a comment - When running Java 6, using http://download.oracle.com/javase/6/docs/api/java/lang/management/ThreadMXBean.html might be more "portable" and could also be used to find deadlocks, I think.

          People

          • Assignee:
            Jerry Cwiklik
            Reporter:
            Jerry Cwiklik
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development