Green Hills Integrity Dynamic memory allocation

蓝咒 提交于 2019-12-25 03:19:10

问题


I have a requirement which need to repeatedly allocate and deallocate memory. Currently trying it on Integrity ARM simulator.

I have created two tasks : First task(encoder): receives video data from a socket and encodes it and send it to second task. Second task(decoder): receives data from encoder and decodes it. In this decoding process it dynamically allocates memory and after decoding deallocates memory.

After some time decoder task is suspended and cannot read protected memory error comes. How can i resolve this dynamic memory issue? I dont want to use fixed size arrays.

Thanks


回答1:


I see this is an old post and you probably already found a fix but I've seen a similar behaviour in Integrity when the memory reserved for the virtual address space in the int file is not sufficient. Try increasing the MemoryPoolSize and/or HeapSize in your VAS int file. Also check again that the same amount of memory you allocate is later properly deallocated. I know the error you see doesn't seem to be related to a lack of memory but I've seen Integrity behave very strange when memory for the VAS is exhausted. You can check your memory usage to see if you are approaching the limit by using INDRT2 debug session and the 'lt' command which will report the Used/Size memory pool size per VAS.

Good luck!



来源:https://stackoverflow.com/questions/26871040/green-hills-integrity-dynamic-memory-allocation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!