COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 09-21-2017, 02:48 AM   #1
JonOsterman
Human being with feelings
 
Join Date: Aug 2017
Posts: 50
Default RAM reflection

Hi,

Working on my project, I had some thoughts about RAM optimization :

- Where would you put the average RAM consumption for a VST plugin ? Mine is around 20-30Mb under FL Studio (so 80-90 if I include FL)

- When I close my plugin (VST3 for example) the RAM consumption doesn't back down, is there a way to free/delete things ? Putting them in Destructor doesn't seems to work
JonOsterman is offline   Reply With Quote
Old 09-25-2017, 05:51 AM   #2
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,653
Default

In general the best place to allocate RAM is in your constructor, and the free in your detructor. However, sometimes you will need to know the max. block size, so you might want to (re)allocate in Reset(). You should try really hard to prevent allocations in ProcessDoubleReplacing(), as this could result in audio dropouts.

Now, most RAM usage will likely come from your GUI (image resources). If so, then your constuctor will indeed not free them, because they are static (i.e shared among instances).

That being said, REAPER has the option to fully unload VST plug-ins, which does free shared memory after the last instance is removed. However, I don't know if this also applies to VST3.
Tale is offline   Reply With Quote
Old 09-25-2017, 07:46 AM   #3
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by Tale View Post
That being said, REAPER has the option to fully unload VST plug-ins, which does free shared memory after the last instance is removed.
Assuming the plugin actually does free up all its allocated memory. Just unloading a DLL from the outside (by the host) does not automatically free the memory allocated by that DLL.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 09-27-2017, 01:58 AM   #4
JonOsterman
Human being with feelings
 
Join Date: Aug 2017
Posts: 50
Default

Ok so there is some allocated data that I can't free, thanks
JonOsterman 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 07:44 PM.


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