Announcement

Collapse
No announcement yet.

Graticule using SurfacePolyline => memory leak => performance breakdown

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Graticule using SurfacePolyline => memory leak => performance breakdown

    Hi there,

    for a long time already graticules have the framework to be used with SurfacePolyline instead of Polyline via the flag AbstractGraticuleLayer.useSurfaceShapes. However, because this flag is inaccessible, nobody could use it to find the 3 bugs that would follow. This is one of them:

    GraticuleSupport.surfaceObjects collects the SurfacePolylines to render per frame. However, this field is never cleared and thus rapidly accumulates countless references to the same SurfacePolylines which are to be rendered each frame. This (minor) memory leak of references leads to a massive performance drop because of the ever-growing number of renders. The interface becomes unusable after less than a minute.

    Solution: At the beginning of the each GraticuleSupport.preRender() clear the reference list: this.surfaceObjects.clear().

    Cheers!

  • #2
    SurfacePolyline or just a Polyline that is set to follow the terrain WILL increase CPU usage and cut down on performance.

    What requirement do you have that requires the Graticule lines to follow the terrain ??

    You have 3 'Bug' posts this morning on this. Rather than 'Bugs' could it be that you are pushing the limits as contemplated for your particular case.
    Neil
    http://www.nlneilson.com

    Comment


    • #3
      You did not even take a look at this bug, you are just speculating, right?

      Comment


      • #4
        I did not change the code in my LatLon Graticule Layer to see your perceived 'bug'.

        As asked before:
        "What requirement do you have that requires the Graticule lines to follow the terrain ??"

        I do not use terrain following in my 'Grid' layer nor does many WWJ users.
        Apparently you have resolved YOUR problem, good for you.
        Neil
        http://www.nlneilson.com

        Comment


        • #5
          One Look is Worth A Thousand Words

          Code:
          I did not change the code in my LatLon Graticule Layer to see your perceived 'bug'.
          You can rest assured that this bug exists, at least until you made the effort to obtain an own "perception" on this matter.

          Code:
          "What requirement do you have that requires the Graticule lines to follow the terrain ??"
          This does not enter into it, as I am not asking for a solution but instead am offering a solution to a bug others will run into as well if they try to use the useSurfaceShapes flag.
          But to answer your question, a more performant solution for graticules was wanted as PolyLines in high numbers will affect performance severely, which can happen at certain camera angles. SurfacePolylines perform much better in this regard.

          Code:
          I do not use terrain following in my 'Grid' layer nor does many WWJ users.
          Indeed you do, if you use the unchanged LatLonGraticuleLayer, just like everyone else. A very close look at your graticule polylines will reveal to you, that for each and every single one of them the "followTerrain" flag will be set to true. Otherwise your graticule would appear mighty out-of-place.
          Or is it just a matter of "perception"?

          Back to serious work.

          Comment


          • #6
            Thanks BuM,
            It's worked for me the CPU usage

            Comment

            Working...
            X