We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Memory Leaks In Single Page Vue Application

Home Forums Programming Memory Leaks In Single Page Vue Application

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #29440
    shantiscript
    Customer

    Hi,
    i am building a single page application with vue.js and verge using your lately released vue template.
    Thanks a lot for the template, it made the setup process quite fast.

    When loading different verge scenes using vue router and the template components a memory leak occurs as the app and scene data is not cleaned up automatically. This causes the app to stop working

    I managed to fix this problem by returning the created verge App instance from the createApp() method and then using the app dispose() method to clean up the app.

    dispose verge api link

    All works well now and i can load as many scenes as i want. Here is the implementation of the script in the vue template

    <script>
    import * as V3DApp from '../verge3d/app.js'
    
    export default {
      name: 'V3DApp',
      props: {
        app: {
          type: String,
          required: true
        }
      },
      data: function() {
        return {
          containerId: V3DApp.CONTAINER_ID,
          vergeApp: null
        }
      },
      mounted: function() {
        this.vergeApp = V3DApp.createApp()
      },
      beforeDestroy() {
        // this.vergeApp.unload()
        this.vergeApp.dispose()
      }
    }
    </script>

    The memory footprint of the app sometimes still behaves a bit strange it seems rather big after loading multiple scenes. But that could be just a strange browser behaviour.

    Thats why i wanted to ask if there is additional things that should be removed from memory??

    -The cleaned up vergeApp instance stays in memory. Should be deleted as well? Not sure if it is auto garbage collected?
    – is it enough to call dispose() or do i need to call first unload() and then dispose(). It’s not 100% clear what the difference between dispose and unload is reading the api docs
    – is there anything else that should be removed from memory (can’t think of something else but maybe i am missing something)

    Thanks for all of your great work on Verge

    Kind Regards
    Sebastian

    #30327

    Hi,

    we fixed the issue with memory leaks in the preview version 3.3 pre2. Please give it a try.

    Chief 3D Verger | LinkedIn | Twitter

    #30730
    shantiscript
    Customer

    Thats fantastic, thanks.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.