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

Capacity is not used and memory waste in QuadTreeNode

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • 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

        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);
        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
        Hide
        Chris A. Mattmann added a comment -

        Old issue different arch now

        Show
        Chris A. Mattmann added a comment - Old issue different arch now

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development