Spatial Information Systems
  1. Spatial Information Systems
  2. SIS-39

Capacity is not used and memory waste in QuadTreeNode

    Details

    • Type: Bug Bug
    • Status: In Progress
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 0.5
    • Component/s: Storage
    • Labels:
      None

      Description

      Either 'capacity' should be properly used. Or null checks are necessary in all places where the raw 'data' array is used. Also what happens if the data array is full? addData should at least throw an exception then:

        public void addData(QuadTreeData data) {
          if (this.dataCount < this.capacity) {
            this.data[dataCount] = data;
            this.dataCount++;
          }
        }
      

        Activity

        Peter Karich created issue -
        Hide
        Peter Karich added a comment - - edited

        Also the 'dataCount' limit is not always correctly used, e.g. in QuadTree in method 'isSimilarQuad' there the array length is used instead.

        Also in L. 171 might be a bug regarding that 'capacity' thing:

        if (u.getCount() < this.capacity) {
               u.addData(data);
        
        Show
        Peter Karich added a comment - - edited Also the 'dataCount' limit is not always correctly used, e.g. in QuadTree in method 'isSimilarQuad' there the array length is used instead. Also in L. 171 might be a bug regarding that 'capacity' thing: if (u.getCount() < this .capacity) { u.addData(data);
        Chris A. Mattmann made changes -
        Field Original Value New Value
        Assignee Chris A. Mattmann [ chrismattmann ]
        Chris A. Mattmann made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Chris A. Mattmann added a comment -

        In r1307718, I committed a start at addressing this. Improvements welcome!

        Show
        Chris A. Mattmann added a comment - In r1307718, I committed a start at addressing this. Improvements welcome!
        Hide
        Chris A. Mattmann added a comment -
        • classify and schedule
        Show
        Chris A. Mattmann added a comment - classify and schedule
        Chris A. Mattmann made changes -
        Fix Version/s 0.3-incubating [ 12319867 ]
        Component/s storage [ 12313714 ]
        Chris A. Mattmann made changes -
        Fix Version/s 0.4 [ 12324609 ]
        Fix Version/s 0.3 [ 12319867 ]
        Martin Desruisseaux made changes -
        Fix Version/s 0.5 [ 12326492 ]
        Fix Version/s 0.4 [ 12324609 ]

          People

          • Assignee:
            Chris A. Mattmann
            Reporter:
            Peter Karich
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development