-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LMMS Memory Manager #1088
LMMS Memory Manager #1088
Conversation
I'll just link to the mailthread for easy finding later http://linux-multimedia-studio-lmms.996328.n3.nabble.com/LMMS-Memory-Manager-td10076.html |
66 files changed and counting... this is building up to a pretty massive pull request. I might have to write a whole brief just to document all the changes to the codebase done here... Note about the current state of the branch (in case someone is testing this): the vol/pan knobs on instruments are temporarily broken... not a bug, just unfinished business. Will be addressed before this branch gets merged. |
Holler if you want a windows build. I feel bad I haven't been helping with testing lately, but I can at least fire off a build for our testers... :) |
Nah, not just yet, see: broken knobs. But yeah I'll let you know, thanks. |
@tresf, the vol/pan functionality is restored now. |
Ok, I tried to build this, but it appears it still needs some work for the terribly fussy win32 world: I remember with the SWH ladspa C files there were quite a few Win32 forward-declaration workarounds but that is just speculation.
|
On 08/27/2014 11:31 PM, Tres Finocchiaro wrote:
Well, someone needs to step up to deal with this, or the next version of |
I spent some time on it to no avail. I'm pretty sure the offending line is here ( |
That's just a macro for overriding new/delete operators. It's necessary to make the class use the MemoryManager instead of doing direct heap allocations. It's used in many other classes as well. |
Yes, I see that. This issue only occurs during the linking process, which isn't uncommon from what I've seen with MinGW. Without much knowledge of the macro realm, could you explain a bit to me so that I can research some of the techniques used against the internet of things? |
On 08/28/2014 02:15 AM, Tres Finocchiaro wrote:
A macro is a command for the C PreProcessor (CPP, not to be confused What it does is basically just string replacement. When you #define a Here, the macro simply adds operator overrides to the classes where it |
Ok thanks. Some of the mingw posts I read mentioned the preprocessor and how it can cause linking issues. I have to read more, but that puts me in the right direction. |
So the preprocessor stuff I'm stumbling on warns of something refereed to as "name mangling". MinGW has a page dedicated to this. Unfortunately the majority of it is above my head. Here's the article... http://www.mingw.org/wiki/Interoperability_of_Libraries_Created_by_Different_Compiler_Brands Edit: ... and another article... http://www.transmissionzero.co.uk/computing/building-dlls-with-mingw/ Seems we use this approach in |
m_instrument( instrument ) | ||
{ | ||
} | ||
InstrumentPlayHandle( Instrument * instrument, InstrumentTrack* instrumentTrack ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tobydox, should this be class EXPORT InstrumentPlayHandle
? It's the only way I could get compilation for Win32/64 to succeed but I'm just taking guesses here.
For anyone willing to test (@musikBear, @Sti2nd, @StakeoutPunch) here are windows builds of master with new MemoryManager. |
On 08/28/2014 03:37 PM, Stian Jørgensrud wrote:
Nope, it's not wrong. The LMMS CPU meter does not necessarily correlate |
Oooh |
I posted a bug here: #1108 |
Ok, did a sync and rebase, to get Toby's GUI-less rendering fix in. So now it should be possible to benchmark this branch against the current master. I'd be very interested to know if there are any quantifiable performance benefits. |
So this isn't exactly a benchmark, but I compared memory usage on Win7 x64: Memory Usage - unfa-Spoken.mmpz
There're many reasons why this shouldn't be considered even a reasonably accurate benchmark: First - It compares an EOL branch to a Bleeding edge branch so there are way too many changes to make any argument that the MemoryManager changes have contributed to this. Second - Memory efficiencies shouldn't be measured by the memory overhead, but rather the engine efficiency as a whole (including spikes, io tomes, etc). However, despite all of this I still wanted to share some early findings. 🐰 |
With the Memory Manager Branch, I can master a rendered track in a new file. |
On 08/30/2014 04:29 PM, Tres Finocchiaro wrote:
Oh no, it's probably fairly accurate. Memory usage /is /going to increase quite a bit with the MemoryManager - All of this causes some waste in memory, but here's the thing... I don't |
What you mentioned about ram being cheap. I wonder if someone has an SSD a On Sun, Aug 31, 2014 at 8:11 AM, Vesa V notifications@github.com wrote:
Jonathan Aquilina |
On 08/31/2014 09:24 AM, eagles051387 wrote:
That's for the OS to handle with swap partitions and such. We're not |
Avoid crashes caused by worker threads accessing the buffer manager before it is initialized. Therefore initialize it from within the Mixer constructor which has the side effect that it gets initialized in console-only rendering mode as well.
Samplebuffer: reload all samples when samplerate changes. This is because of the way LMMS uses samples: we always resample all samples t$ LadspaEffect: some safeguards for the non-inplacebroken plugins which use the same buffer for input and output. Theoretically, if some p$ FxMixer: fix effect processing in multichannel-chains
Add treshold knob to peak controller This causes the peak controller to react only when the measured peaks are above the set treshold Might be useful for finetuning your sidechains
So, I think I'm just going to merge this branch now. There's so many commits here, getting troublesome to keep this in sync with master, etc... so any performance issues can be profiled and fixed later - if we bother to work much more on 1.2 anymore, since it seems we could just skip right into 2.0... |
This memory manager should be dropped. I do not think it is better than the allocator in glibc. The use of a custom manager should be centered on objects created by the mixer, and leave out other objects such as |
👍 for TLSF that I use in the top 1 commercial video games sound engine. |
I have been looking at TLSF and glibc malloc. They both use locks for multiple threads. Without locks, an inefficient allocation method is needed. One conclusion is that Allocation methods that do not consider a maximum usage incur a memory pool extension, which affects real-time processing. General purpose allocators face fragmentation, which makes the pool extension more likely. So the way to be lockless is to use structures with a maximum number of same-sized elements, something like |
See post on mailing list for details.
Testing appreciated before merging.