HISE Logo Forum
    • Categories
    • Register
    • Login

    Memory leak with Engine.loadAudioFilesIntoPool

    Scheduled Pinned Locked Moved Scripting
    10 Posts 4 Posters 184 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      Elezeid
      last edited by

      Hey folks, I have a handful of IRs linked to a ComboBox, and I'm using:

      const irs = Engine.loadAudioFilesIntoPool();

      It works fine, however in the DAW if you stop the playhead and restart the track, or close the plugin window (with plugin still running) and reopen it, it seems to load those audio files, which are already loaded, thus doubling the amount of RAM in use by those files. Over time, this becomes a huge memory issue, and projects become unusable. It's saved in the plugin state, so closing and reopening the DAW doesn't solve the issue, assuming you are running the same project file.

      Issue persists in Cubase, Reaper, and FL Studio.

      I couldn't find a solution for this, but I thought something like

      Engine.purgeAudioFilesFromPool(); above it might do the trick, so it purges before loading.

      Unfortunately no such thing seems to exist.

      Does anyone have a potential fix, or alternative for this? Thanks in advance.

      d.healeyD dannytaurusD 2 Replies Last reply Reply Quote 0
      • d.healeyD
        d.healey @Elezeid
        last edited by

        @Elezeid said in Memory leak with Engine.loadAudioFilesIntoPool:

        const irs = Engine.loadAudioFilesIntoPool();

        You're calling this in on init?

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        E 1 Reply Last reply Reply Quote 0
        • E
          Elezeid @d.healey
          last edited by

          @d-healey

          Yes. Is there a better way?

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @Elezeid
            last edited by

            @Elezeid Nope, that's correct.

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            E 1 Reply Last reply Reply Quote 0
            • E
              Elezeid @d.healey
              last edited by

              @d-healey Dang, I thought there was gonna be an alternative 😅

              Thanks anyway. I'll check back periodically hoping that someone has a solution or workaround. 🤞

              d.healeyD 1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey @Elezeid
                last edited by

                @Elezeid Are you 100% sure it's caused by that function call?

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public HISE tutorials

                E 1 Reply Last reply Reply Quote 0
                • dannytaurusD
                  dannytaurus @Elezeid
                  last edited by

                  @Elezeid said in Memory leak with Engine.loadAudioFilesIntoPool:

                  Engine.loadAudioFilesIntoPool();

                  Are you sure you aren't calling this function anywhere else in your code?

                  Meat Beats: https://meatbeats.com
                  Klippr Video: https://klippr.video

                  1 Reply Last reply Reply Quote 0
                  • ChazroxC
                    Chazrox
                    last edited by Chazrox

                    I would probably first check to see if changing 'save in preset' for your combobox changes anything. Depending on how you're using your combobox that might help.

                    I would probably next, check on anything calling .changed(); on your combobox....

                    ie; if you have a rogue 'next/previous' button calling .changed(); at the wrong time.

                    def sounds like you have a weird loop somewhere.

                    @dannytaurus said in Memory leak with Engine.loadAudioFilesIntoPool:

                    Are you sure you aren't calling this function anywhere else in your code?
                    Engine.loadAudioFilesIntoPool();

                    and this ☝

                    1 Reply Last reply Reply Quote 0
                    • E
                      Elezeid @d.healey
                      last edited by

                      @d-healey Yes. When this line is commented out, the issue is gone.

                      @dannytaurus Yes. I used ctrl+F to make sure.

                      @Chazrox there aren't any other functions like that tied to the combo box, the script is copied line for line from one of David Healey's tutorials. It's possible that it's become outdated?

                      I'll try unchecking "save in preset" but it's sort of an integral component of my presets, so if that does fix it, then I'll be in some trouble haha.

                      d.healeyD 1 Reply Last reply Reply Quote 0
                      • d.healeyD
                        d.healey @Elezeid
                        last edited by

                        @Elezeid said in Memory leak with Engine.loadAudioFilesIntoPool:

                        I used ctrl+F to make sure.

                        That only searches the current view, did you check all scripts in your project and all callbacks? There is a Find All Occurrences tool (ctrl + shift + f) that might help. However I doubt this is the issue since you say commenting out that line solves it.

                        Libre Wave - Freedom respecting instruments and effects
                        My Patreon - HISE tutorials
                        YouTube Channel - Public HISE tutorials

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        23

                        Online

                        1.8k

                        Users

                        11.9k

                        Topics

                        103.8k

                        Posts