Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 03-02-2023, 02:27 PM   #1
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default Severe resource leak (only tested on Windows)

Dear devs,

this is a bug that has been haunting me for years. I finally could repro it reliably.

Short version: When loading VST plugins, REAPER's GDI objects rise without getting released.


Long version:

Every time, a VST plugin is added to REAPER, the GDI objects are increased.
I guess that is a normal process. Nothing wrong with that.
However, when unloading those plugins, the resources are not released.

This results in a never ending growth of REAPER's GDI objects and REAPER becomes slower and slower. And every time I close an old project and load a new one, this resource leaks adds to itself over time. My GDI peak was at 1700 objects. The only thing that helps... you guessed it: closing REAPER.


Some figures:

Windows 10

REAPER vanilla:
106 GDI objects

REAPER with 3 Kontakt instances:
228 GDI objects

REAPER project unloaded:
228 GDI objects


(this was only a quick test I did, I can do one with more instances, etc...)


Any chance you can have a look at this one?
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 03-02-2023, 02:32 PM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,746
Default

Is the "full unload of VST plug-ins" option enabled? If not, does enabling it help?

Can you list some other plug-ins that have this issue? Do the built-in reaplugs share it?
Justin is online now   Reply With Quote
Old 03-02-2023, 03:27 PM   #3
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

Yes, it happens with unload ticked or unticked.

Sorry, I had posted before but deleted my post. I chose a different testing method.

I launch REAPER, insert a track and instantiate a plugin. Then I remove the plugin and note the GDI.

Kontakt 6
after inserting and removing it once: 194
after inserting and removing it 5 times: 266

ReaEQ
after inserting and removing it once: 149
after inserting and removing it 5 times: 151

Omnisphere
after inserting and removing it once: 157
after inserting and removing it 5 times: 159


So, from what I can see, the last 2 plugins only add 2 GDI and I think that value is stabilized after a while. But Kontakt goes totally through the roof.
I will collect more plugins...
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom

Last edited by _Stevie_; 03-02-2023 at 03:36 PM.
_Stevie_ is offline   Reply With Quote
Old 03-02-2023, 03:55 PM   #4
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

LiquidSonics Cinematic Rooms:
after inserting and removing it once: 180
after inserting and removing it 5 times: 206


UVIWorkstation:
after inserting and removing it once: 180
after inserting and removing it 5 times: 206


Orchestral Tools SINE:
after inserting and removing it once: 186
after inserting and removing it 5 times: 212


Best Service Engine:
after inserting and removing it once: 166
after inserting and removing it 5 times: 235



EDIT: I tried closing the project, after having removed the plugin. Most plugins go back to their previous GDI level. So, closing a project might do some extra cleaning.
However, Kontakt 6 is still affected and hogs GDI.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom

Last edited by _Stevie_; 03-02-2023 at 04:08 PM.
_Stevie_ is offline   Reply With Quote
Old 03-03-2023, 11:15 AM   #5
playtimer
Human being with feelings
 
Join Date: Mar 2014
Posts: 266
Default

I don't know for sure, but I suspect similar thing happens on my side with Solid State Logic SSL Native plugins.

Upon loading one instance of X-EQ2 CPU usage goes from 12-18% which is very high. This didn not happen before.

And upon unloading any SSL plugin the CPU usage stays the same. It can be released only when fully quitting Reaper.

I have not noticed any problem in Cubase 12 Pro or Studio One 6 so far.

Emailed SSL support just in case, but perhaps devs should look into Reaper's issue too?

EDIT: Posted in wrong thread thinking it's related to this one.
New thread with complete issue is here:
https://forum.cockos.com/showthread....19#post2655019
__________________
Reaper 6|Cubase 12 Pro|Studio One 6 Pro|UA Apollo/Apollo X/UAD Quad PCie x2|Adam A5x & Adam Sub7|IK iLoud Micro|Faderport 8|Presonus Atom|Nektar Panorama P6|Nektar Aura|Focusrite ISA One|ART Pro VLA II|Townsend Labs Sphere L22|Neumann & Rode mics

Last edited by playtimer; 03-03-2023 at 12:40 PM. Reason: wrong thread
playtimer is offline   Reply With Quote
Old 03-03-2023, 12:28 PM   #6
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

Not sure if I mentioned that already: the main issue with this bug is that the MIDI Editor gets slower and slower. Maybe that gives another clue?

Right now, it takes 2 seconds to open the ME (with 1300 GDIs).
I guess I should restart REAPER...
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 03-03-2023, 01:46 PM   #7
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

Just posting a video, so you get an idea how severe it really is:
https://nextcloud.stephanroemer.net/...4bF4sresLcfybS


The MIDI Editor opens really slowly (hence the screen turning white for a moment).
MIDI scripts don't work fast enough anymore, it seems like they are 1 frame per second.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 03-03-2023, 02:27 PM   #8
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,746
Default

If you look at other things in the task manager, are there other increases? e.g. threads?


increases in GDI objects shouldn't slow the MIDI editor opening, something else may be going on...
Justin is online now   Reply With Quote
Old 03-04-2023, 09:43 AM   #9
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

I checked the threads, they go down to 89 every time I close a project. So it shouldn't be that.
I can't spot anything else that looks suspicious. The GDIs are literally the only ones that keep growing and growing. Is there anything else you could think of?
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 03-04-2023, 10:48 AM   #10
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

Quote:
Originally Posted by _Stevie_ View Post
Not sure if I mentioned that already: the main issue with this bug is that the MIDI Editor gets slower and slower. Maybe that gives another clue?

Right now, it takes 2 seconds to open the ME (with 1300 GDIs).
I guess I should restart REAPER...
FWIW, I've never seen performance affected by GDI count, and 1300 is far from the 10K limit.

Just curious, what if you simply toggle the visibility of the ME window instead of closing/opening it, is it just as slow? Example toggle script, hide foreground window/show previous hidden window
https://forum.cockos.com/showpost.ph...52&postcount=3

Maybe by not closing it, it will eventually reveal the real problem?
Edgemeal is offline   Reply With Quote
Old 03-04-2023, 11:32 AM   #11
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

Yeah, I think the GDI thing might be a side effect by the real cause.

I'm trying everything right now. I have been battling with this issue for 3 years now.
I finally want to find the root of the issue.

Will try your script! This action here will only likely open / close I guess?
Code:
View: Toggle show MIDI editor windows
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 03-04-2023, 03:25 PM   #12
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,746
Default

Quote:
Originally Posted by _Stevie_ View Post
I checked the threads, they go down to 89 every time I close a project. So it shouldn't be that.
I can't spot anything else that looks suspicious. The GDIs are literally the only ones that keep growing and growing. Is there anything else you could think of?
Does opening and closing the MIDI editor cause GDI objects to grow?

If you bypass the Kontakt instances (or all the track fx) does that speed up the midi editor opening when its slow?
Justin is online now   Reply With Quote
Old 03-05-2023, 08:20 AM   #13
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

Quote:
Originally Posted by Justin View Post
Does opening and closing the MIDI editor cause GDI objects to grow?

If you bypass the Kontakt instances (or all the track fx) does that speed up the midi editor opening when its slow?
AFAICT, no they aren't growing by opening and closing the ME. I'm still investigating heavily here, because I don't want to waste your precious time. What I found out by now is, that when I leave the ME open on a different screen and don't do the open / close thingy, then the performance seems to be stable (despite the higher GDI objects). I will get back to you with new findings ASAP.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 03-08-2023, 03:11 PM   #14
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

Hey Justin,

sorry for taking so long to get back to you, but I was trying a couple of things here, in order to find the root of the problem.

So I came to the conclusion that the issue is there from the beginning but it's worsening over time. I suspect a redraw issue. Which does not seem to happen on macOS.

In general, the MEs speed/refresh rate is affected by the arrange window. If there are a lot of items displaying (= they are in view), then scripts executed in the ME are slowed down. From what I can see, this affects scripts that are moving graphical things like any nudge note/CC script and also JS MultiTool.
Native actions seem not (!) to be affected (Like "move X 1 pixel").

You can see the result here. It's a project with around 1500 MIDI items.
First, nudging notes with items in view, then moved out of view.

Windows 10: a freshly started REAPER instance:
https://nextcloud.stephanroemer.net/...PSRXt69mrBjz8y

Windows 10: a REAPER instance that has been up for like 5 hours, with closing and opening projects, editing, saving, etc...
https://nextcloud.stephanroemer.net/...sCjFfTEwcsG3AG

macOS Ventura on a MacBook Air M1: freshly started instance:
https://nextcloud.stephanroemer.net/...qF7wb985ABx68K

Here's the MIDI project:
https://nextcloud.stephanroemer.net/...EfjDnTPmsXmAWs


The Windows instance is already very slow and stuttery from the beginning,
whereas in macOS it's super smooth.

This is as much evidence I could find, for now. If you got any other pointers to what could be worth checking, then please do tell.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 03-10-2023, 02:12 PM   #15
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

I just checked on different Windows machine:
I can definitely repro the slow MIDI scripts in the ME when the arrange is crowded with items.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 03-10-2023, 02:56 PM   #16
inthevoid
Human being with feelings
 
inthevoid's Avatar
 
Join Date: May 2022
Location: London
Posts: 444
Default

Quote:
Originally Posted by _Stevie_ View Post

So I came to the conclusion that the issue is there from the beginning but it's worsening over time. I suspect a redraw issue. Which does not seem to happen on macOS.

In general, the MEs speed/refresh rate is affected by the arrange window. If there are a lot of items displaying (= they are in view), then scripts executed in the ME are slowed down. From what I can see, this affects scripts that are moving graphical things like any nudge note/CC script and also JS MultiTool.
Native actions seem not (!) to be affected (Like "move X 1 pixel").
Have the same issue here - slowdown in the MIDI editor on my Windows desktop the more MIDI items are in the arrange view. Will test on my Mac Pro tomorrow.

Last edited by inthevoid; 03-31-2023 at 11:49 AM.
inthevoid is offline   Reply With Quote
Old 03-10-2023, 04:32 PM   #17
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

OMG, thank you! Now I feel less stupid.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 03-14-2023, 08:06 AM   #18
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

Hey Justin, just checking if you had time to check the things I posted.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 03-23-2023, 12:17 PM   #19
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

New findings: it doesn't seem only related to the MIDI Editor. The action list also starts extremely slow, when REAPER is caught into that "slow down mode".

__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 03-23-2023, 08:54 PM   #20
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,746
Default

If you temporarily disable undo completely (set undo limit to 0mb), does that change anything?
Justin is online now   Reply With Quote
Old 03-24-2023, 07:32 AM   #21
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

Quote:
Originally Posted by Justin View Post
If you temporarily disable undo completely (set undo limit to 0mb), does that change anything?
Will try that over the weekend and report back next week1
JFYI: I currently had my undo history set to 512 MB.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 03-31-2023, 11:48 AM   #22
inthevoid
Human being with feelings
 
inthevoid's Avatar
 
Join Date: May 2022
Location: London
Posts: 444
Default

Sorry, it took a while to get around to testing this (on 6.78). I've just tested on an M2 MacOS system and I get very laggy GUI in the arrange window when more of my screen is taken up by the items. The issue actually worsens the more of my screen is taken up by the items - if I zoom out so that for example the items only take up 1/4 of the whole screen, the GUI performance becomes silky smooth again.

So when viewing 100 MIDI items with them taking up my whole display, drawing a marquee box (for example) is quite laggy, but viewing 100 MIDI items zoomed out with them only taking up 1/4 of my display, everything is very smooth.

Last edited by inthevoid; 03-31-2023 at 11:58 AM.
inthevoid is offline   Reply With Quote
Old 03-31-2023, 01:26 PM   #23
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

@Justin, sorry, it took me longer because I wanted to test this thouroughly.
It's definitely not the undo history. I played around with all kinds of settings.

I agree with the observations that inthevoid has made.

The problem right now is that I am confronted with 2 different issues that stacked on top of each other, make the whole situation worse:

1. MIDI Scripts get slower in the ME, when a lot of items are displayed in the arrange
2. The MIDI Editor becomes slower over time, when loading / unloading projects.

I think #1 could be addressed somehow? But for #2 I need to find the root of the problem. I'm still investigating, but it's really hard to track down.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom

Last edited by _Stevie_; 03-31-2023 at 03:36 PM.
_Stevie_ is offline   Reply With Quote
Old 03-31-2023, 02:38 PM   #24
tonalstates
Human being with feelings
 
tonalstates's Avatar
 
Join Date: Jun 2020
Posts: 666
Default

Quote:
Originally Posted by inthevoid View Post
Sorry, it took a while to get around to testing this (on 6.78). I've just tested on an M2 MacOS system and I get very laggy GUI in the arrange window when more of my screen is taken up by the items. The issue actually worsens the more of my screen is taken up by the items - if I zoom out so that for example the items only take up 1/4 of the whole screen, the GUI performance becomes silky smooth again.

So when viewing 100 MIDI items with them taking up my whole display, drawing a marquee box (for example) is quite laggy, but viewing 100 MIDI items zoomed out with them only taking up 1/4 of my display, everything is very smooth.
I also experience this on Mojave 10.14, but not just with midi items, I usually don't have many, just regular audio items, zooming in slows everything down until I zoom out
tonalstates is offline   Reply With Quote
Old 04-01-2023, 09:04 AM   #25
inthevoid
Human being with feelings
 
inthevoid's Avatar
 
Join Date: May 2022
Location: London
Posts: 444
Default

Interestingly I've just loaded up an orchestration project (so lots of MIDI items but without any VIs loaded in) and the project is super smooth.. so maybe it's something to do with latency inducing plugins?
inthevoid is offline   Reply With Quote
Old 04-01-2023, 10:43 AM   #26
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

Yes, I made the same experience. The issue is only there, if there are VSTs loaded! Projects with no plugins are super smooth.

I guess only the devs would know what kind of connection there is.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 04-01-2023, 01:10 PM   #27
inthevoid
Human being with feelings
 
inthevoid's Avatar
 
Join Date: May 2022
Location: London
Posts: 444
Default

Quote:
Originally Posted by _Stevie_ View Post
Yes, I made the same experience. The issue is only there, if there are VSTs loaded! Projects with no plugins are super smooth.

I guess only the devs would know what kind of connection there is.
Yes you’re right - just been doing work in a project today with MIDI and no VSTis and it’s completely smooth.
inthevoid is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:09 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.