java3d
  1. java3d
  2. JAVA3D-561

Decrease memory footprint of BoundingBox

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.1
    • Fix Version/s: 1.5.2
    • Component/s: j3d-core
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      561

      Description

      This issue is discussed in the forum in:
      http://forums.java.net/jive/thread.jspa?messageID=255528&#255528

      In short: I've found that BoundingBox has four instance level fields that could
      either be made static or removed and allocated on the spot. I've made an
      implementation of the static version and it seems to work.

      1. BoundingBox.java
        59 kB
        paasiala
      2. BoundingBox-patch.diff
        7 kB
        paasiala
      3. MasterControl.java
        125 kB
        paasiala
      4. MasterControl.java
        125 kB
        paasiala

        Activity

        Hide
        paasiala added a comment -

        Created an attachment (id=350)
        Improvement: set the field package protected

        Show
        paasiala added a comment - Created an attachment (id=350) Improvement: set the field package protected
        Hide
        kcr added a comment -

        Set target milestone to 1.5.2.

        The changes to BoundingBox.java look fine. You need to redo the property setting
        code in MasterControl.java to use the same pattern as the other properties in
        MasterControl. Please do not deviate from this pattern as there are good reasons
        for leaving it the way it is (plus code consistency is important). Note that
        there must be no public set methods in that class. See, for example, how
        forceReleaseView is set.

        Show
        kcr added a comment - Set target milestone to 1.5.2. The changes to BoundingBox.java look fine. You need to redo the property setting code in MasterControl.java to use the same pattern as the other properties in MasterControl. Please do not deviate from this pattern as there are good reasons for leaving it the way it is (plus code consistency is important). Note that there must be no public set methods in that class. See, for example, how forceReleaseView is set.
        Hide
        kcr added a comment -

        I went ahead and integrated this change, since only a trivial modification was
        needed to MasterControl.java. Please test this and let us know if it works for you:

        java -Dj3d.releaseBoundingBoxMemory=true MyMainClass

        Show
        kcr added a comment - I went ahead and integrated this change, since only a trivial modification was needed to MasterControl.java. Please test this and let us know if it works for you: java -Dj3d.releaseBoundingBoxMemory=true MyMainClass
        Hide
        paasiala added a comment -

        Thanks for doing the last fixes. I ran a project with profiler then I took the
        latest nightly build and ran the same project again. Here are the results:

        Point3d
        Before: 2 164 110 instances 84 535 MB
        After: 1 358 015 instances 53 047 MB

        BoundingBox
        Before: 650 265 instances 50 801 kB
        After: 572 350 instances 44 714 kB

        Total save: 37 MB

        I mark this fixed.

        Show
        paasiala added a comment - Thanks for doing the last fixes. I ran a project with profiler then I took the latest nightly build and ran the same project again. Here are the results: Point3d Before: 2 164 110 instances 84 535 MB After: 1 358 015 instances 53 047 MB BoundingBox Before: 650 265 instances 50 801 kB After: 572 350 instances 44 714 kB Total save: 37 MB I mark this fixed.
        Hide
        kcr added a comment -
        Show
        kcr added a comment - Added property to list of system properties on our Wiki at: http://wiki.java.net/bin/view/Javadesktop/Java3DApplicationDevelopment#Java_3D_System_Properties

          People

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

            Dates

            • Created:
              Updated:
              Resolved: