Dear all, For one of our module in a A/V based consumer product,we encounter memory fragmentation problem in the following manner: We have static buffer of 405KB.With in this 405KB,we need to allocate memory dynamically depending on the requirement.The situation under which fragmentation happens is: First module gets 44KB Second Module needs 512Bytes Third one needs 44KB Fourth one needs whole of 405KB
The product is in use for long time and the requests for memory comes from a thirdparty application.In the scenerio explained above,44KB is freed from first req,512 bytes is always in use once requested,44KB third request is also freed.Fourth request is not able to find enough memory due to 512 bytes in between.From the way of implementation it seems to me its using First Fit algorithm.Increasing the size may be a solution to solve this problem,but its not possible due to memory constraints. Also the module using this 405KB demands continguous memory per module for effective operation.Static allocation is not possible,as in a given situation we dont know the demand from third party for number of modules it can create.Incase we want to defragment,the 512 bytes prevents clubbing memory above it.So even though 44K is free,we are not able to use it.512 bytes cannot be shifted dynamically because its in use and shifting dynamic can cause disturbing viewer exp.
Can anyone point me any change need to be done in the allocation method to regroup it and get memory?I can provide 512 bytes extra memory as a whole but the modules using it need 256 Byte aligned address which makes it even more tougher.
Looking farward for all your inputs and advanced thanks for the same, Regards, s.subbarayan