lowlevelsoul Posted March 31, 2015 Share Posted March 31, 2015 Hey guys.One of my pet peeves is memory management. It's something that bugs the hell out of me. Not because I dislike it, but because from experience, managing memory can be super critical in making sure that your game runs smoothly and depending on the platform, is stable. The principal idea is to avoid calling the system memory allocation libs as much as possible. This helps would give the following benefits; Performance - system memory calls are typically very costly so they are avoided as much as possible.Helps to reduce overhead caused by OS memory paging/virtual mapping and re-mapping. Helps with stability as free'd memory blocks can be coalesced with surrounding free blocks. Memory fragmentation should not occur or only happen in very rare circumstancesHelps track down issues w.r.t. memory bugsHelps for future platforms with limited memory (mobile, console etc) compared to desktop I tried enabling the memory manager in RC 3.7 and got a whole load of compiler issues. I'm not all that bothered. by that because the existing manager is messy and relies on overriding new within classes to get it to work properly. I'm thinking of implementing a new memory manager with the following requirements; TLSF based - an open source, reliable memory allocation scheme. I know that Unity uses it for it's underlying memory alloc stuff on console.Globally overrides new and delete. Now, I KNOW that this is a massive issue for some folks. But in my view it saves a lot of pain and effort.Memory allocation/free tracking. This comes at the cost of of extra memory usage, but is extremely handy in helping track down unused memory, multiple free bugs etc.Allocate memory in large "pages" which are managed by tlsf.Provide specialized heaps such as a block heap to reduce the cost of frequent small allocations (64-bytes or less)Thread safety - there's an issue here with the way that the thread/mutex stuff is implemented in Torque right now - these would have to be re-jigged. Labeling of where memory is allocated from and why - slightly different than tracking by source file. Able to identify things such as resource/sim usage. I intend to implement most, if not all of these features in my own build and test them out. Now what I want to know from you guys is; Is this something you feel would be useful to you?What other features would you like to see?Is it something that you would like to see in T3D main branch (really one for the steering committee I guess) ? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.