Green Hills Integrity Dynamic memory allocation

1.6k views Asked by At

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

There are 1 answers

0
ivan1123 On

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!