Long commit messages can result in OutOfMemoryErrors

XMLWordPrintable

    • 2
    • Severity 2 - Major
    • 10

      Summary 

      BSERV-7928 applied limits to commit message lengths when retrieving lists of commits, such as during commit indexing and when viewing commit lists via the UI. However, it did not apply such a limit when viewing a single commit. In general, this hasn't shown itself to be problematic. However, extremely large commit messages, such as when performing a squash "merge" of 12,000+ commits, can result in sufficiently high memory usage from a single commit to trigger an OutOfMemoryError. Based on that, a limit needs to be applied even when only viewing a single commit.

      Steps to Reproduce

      Squash merges can create very large commit messages when a very large number of commits are squashed.
      This OoM error can also be reproduced by adding a very large commit message to a commit.

      Expected Results

      Page loads without any error

      Actual Results

      The below exception is thrown in the

      2018-04-03 08:43:36,384 ERROR [http-nio-7990-exec-13] user @1JOPP7Bx523x223981x0 1qikcu2 10.1.1.191 "GET /projects/<project>/repos/<repo>/compare/commits HTTP/1.1" o.a.c.c.C.[.[.[/].[springMvc] Servlet.service() for servlet [springMvc] threw exception
      java.lang.OutOfMemoryError: Java heap space 
      

      Workaround

      No workaround. Try to avoid viewing any single commit which has large commit message and view it in commit list page.

            Assignee:
            Bryan Turner (Inactive)
            Reporter:
            Bryan Turner (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: