Click
  1. Click
  2. CLK-305

Table control might allocate excessive memory

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:
      Click 1.3.1 / 1.4RC2

      Description

      Table#toString() allocate memory for HtmlStringBuffer.

      int bufferSize =
      (getColumnList().size() * 60) * (getRowList().size() + 1);

      However, when Table is paginated, Table control allocates excessive memory.
      I think if the page size is specified, the initial buffer size should be calculated by the page size:

      int bufferSize =
      (getColumnList().size() * 60) * (getPageSize() + 1);
      ^^^^^^^^^^^^^

      I'm using Table with large rows. So sometimes, it causes OutOfMemory by this issue.

        Activity

        Naoki Takezoe created issue -
        Naoki Takezoe made changes -
        Field Original Value New Value
        Description Table#toString() allocate memory for HtmlStringBuffer.

        int bufferSize =
          (getColumnList().size() * 60) * (getRowList().size() + 1);

        However, when Table is paginated, Table control allocates excessive memory. I think if the page size is specified, the initial buffer size should be calculated by the page size:

        int bufferSize =
          (getColumnList().size() * 60) * (getPageSize() + 1);
                                           ^^^^^^^^^^^^^

        I'm using Table with large rows. So sometimes, it causes OutOfMemory by this issue.
        Table#toString() allocate memory for HtmlStringBuffer.

        int bufferSize =
          (getColumnList().size() * 60) * (getRowList().size() + 1);

        However, when Table is paginated, Table control allocates excessive memory.
        I think if the page size is specified, the initial buffer size should be calculated by the page size:

        int bufferSize =
          (getColumnList().size() * 60) * (getPageSize() + 1);
                                           ^^^^^^^^^^^^^

        I'm using Table with large rows. So sometimes, it causes OutOfMemory by this issue.
        Malcolm Edgar made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Malcolm Edgar made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Henri Yandell made changes -
        Project Import Fri Mar 20 14:11:32 PDT 2009 [ 1237583492744 ]

          People

          • Assignee:
            Malcolm Edgar
            Reporter:
            Naoki Takezoe
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development