Green Hills Integrity动态内存分配 [英] Green Hills Integrity Dynamic memory allocation

查看:164
本文介绍了Green Hills Integrity动态内存分配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要重复分配和取消分配内存的要求.目前正在Integrity ARM模拟器上进行尝试.

我创建了两个任务: 第一任务(编码器):从套接字接收视频数据并对其进行编码,然后将其发送给第二任务. 第二项任务(解码器):从编码器接收数据并将其解码.在此解码过程中,它动态分配内存,并在解码后释放内存.

一段时间后,解码器任务挂起且无法读取受保护的内存错误.我该如何解决此动态内存问题?我不想使用固定大小的数组.

谢谢

解决方案

我看到这是一篇旧文章,您可能已经找到了解决方法,但是当为虚拟地址空间保留内存时,我在Integrity中看到了类似的行为int文件中的内容还不够.尝试在VAS int文件中增加MemoryPoolSize和/或HeapSize.还要再次检查您分配的相同数量的内存,以后是否可以正确地重新分配.我知道您看到的错误似乎与内存不足无关,但是当VAS的内存用尽时,我发现Integrity表现得很奇怪.您可以使用INDRT2调试会话和'lt'命令来检查您的内存使用情况,以查看是否已达到极限,该命令将报告每个VAS的已用/大小内存池大小.

祝你好运!

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

解决方案

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!

这篇关于Green Hills Integrity动态内存分配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆