UIMA
  1. UIMA
  2. UIMA-1945

convert recursive impl of CAS Copier to non-recursive to avoid out-of-stack space errors

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.1SDK
    • Component/s: Core Java Framework
    • Labels:
      None

      Description

      User has reported running out of stack space - traced to long UIMA list which was being copied using the CasCopier utility, which places two "calls" for each element of the list on the Java stack.

      Convert this to a non-recursion implementation.

        Activity

        Hide
        Thilo Goetz added a comment -

        Is this really necessary? The code is not exactly transparent as it is, and it will just get more complicated if you turn the relatively straightforward recursion into an iteration. Can't they just increase the stack size of the JVM?

        Show
        Thilo Goetz added a comment - Is this really necessary? The code is not exactly transparent as it is, and it will just get more complicated if you turn the relatively straightforward recursion into an iteration. Can't they just increase the stack size of the JVM?
        Hide
        Eddie Epstein added a comment -

        Can't they just increase the stack size of the JVM?

        Are you serious? Should this UIMA feature be documented as: "If a large list FS is created in the CAS, and the CasCopier is used, be sure to increase the JVM stack size accordingly?"

        Show
        Eddie Epstein added a comment - Can't they just increase the stack size of the JVM? Are you serious? Should this UIMA feature be documented as: "If a large list FS is created in the CAS, and the CasCopier is used, be sure to increase the JVM stack size accordingly?"
        Hide
        Thilo Goetz added a comment -

        Why not? This is a perfectly normal recursive algorithm. CAS lists (and FSs in general) are recursive data structures, and they come with recursive algorithms. If your recursive data structures are so deep as to require an increased stack size, that seems perfectly natural to me. Are we to disallow recursive algorithms on FSs in general? Or flatten each when somebody encounters a problem? I think not.

        Show
        Thilo Goetz added a comment - Why not? This is a perfectly normal recursive algorithm. CAS lists (and FSs in general) are recursive data structures, and they come with recursive algorithms. If your recursive data structures are so deep as to require an increased stack size, that seems perfectly natural to me. Are we to disallow recursive algorithms on FSs in general? Or flatten each when somebody encounters a problem? I think not.
        Hide
        Eddie Epstein added a comment -

        I think there is a difference between user code recursion requiring modification of default JVM parameters and having an unnecessary limitation in UIMA framework code that doesn't have to be there. Not trying to be inflammatory here, just happen to be the user that suffered lost hours because of this problem.

        Show
        Eddie Epstein added a comment - I think there is a difference between user code recursion requiring modification of default JVM parameters and having an unnecessary limitation in UIMA framework code that doesn't have to be there. Not trying to be inflammatory here, just happen to be the user that suffered lost hours because of this problem.

          People

          • Assignee:
            Marshall Schor
            Reporter:
            Marshall Schor
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development