COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 12-24-2016, 06:30 AM   #1
SaschArt
Human being with feelings
 
SaschArt's Avatar
 
Join Date: Aug 2013
Posts: 236
Default Release memory consumed by redraw

I find a problem: when the graphic redraw (called by SetDirty(), IsDirty() and Redraw()) the plugin take a few megabytes from memory and never release them. If the user change too much knobs will consume lot of memory, this is real problem.

Also graphics with dynamic components need continuous redraw which take a lot of memory.

How to release memory after redraw ?
__________________
Audio plugins | BrainWaveProducer | EmRysRa
SaschArt is offline   Reply With Quote
Old 12-24-2016, 09:00 AM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Do you have some custom control class you've written that leaks memory when it draws itself?

There's not much more advice to give than to recommend not using raw pointers and manual new/delete. Prefer value based objects first but if not possible, then use smart pointers.
__________________
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 12-24-2016, 09:05 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 SaschArt View Post
If the user change too much knobs will consume lot of memory, this is real problem.
This may also be because of the host application storing undo states. Is your plugin's state data very large?
__________________
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 12-26-2016, 04:45 AM   #4
SaschArt
Human being with feelings
 
SaschArt's Avatar
 
Join Date: Aug 2013
Posts: 236
Default

Sure have custom control build by me to draw graph with bool IsDirty() { return true;}

Problem is to intersect checking.

Return intersect and redraw even if not really intersect.
__________________
Audio plugins | BrainWaveProducer | EmRysRa
SaschArt is offline   Reply With Quote
Old 12-26-2016, 07:23 AM   #5
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by SaschArt View Post
Sure have custom control build by me to draw graph with bool IsDirty() { return true;}

Problem is to intersect checking.

Return intersect and redraw even if not really intersect.
What does this have to do with memory use? Why is your custom control using and apparently leaking memory when it draws itself?
__________________
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 12-26-2016, 09:09 AM   #6
SaschArt
Human being with feelings
 
SaschArt's Avatar
 
Join Date: Aug 2013
Posts: 236
Default

Using CropBitmap() again and again. Can I cache cropped bitmap in the next call load from cache ?
__________________
Audio plugins | BrainWaveProducer | EmRysRa
SaschArt is offline   Reply With Quote
Old 12-27-2016, 01:42 AM   #7
SaschArt
Human being with feelings
 
SaschArt's Avatar
 
Join Date: Aug 2013
Posts: 236
Default

Any solution to cache cropped bitmap in a custom control to prevent using CropBitmap() to each refresh ?
__________________
Audio plugins | BrainWaveProducer | EmRysRa
SaschArt 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 11:14 AM.


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