Chinaunix

标题: out of memory :killed process [打印本页]

作者: ghnie    时间: 2004-06-23 18:44
标题: out of memory :killed process
应用程序在pc机上运行没有问题
但移植到嵌入式系统上后
运行大概10分钟后应用程序就会退出
并出现提示 : out of memory :killed process 179 (allin)
// allin 是应用程序名
应用程序用Minigui和c语言开发,Minigui作为界面程序,c部分用于对
串口进行读写操作
pc机和嵌入式主板的操作系统均为redhat linux 9
pc机上是完整的系统,嵌入式上为经过裁减的系统.

请问一下:
这时哪里出了问题?
谢谢
作者: windflowers1976    时间: 2004-06-23 20:38
标题: out of memory :killed process
自己去监控下你的程序需要占多少内存空间。
作者: ghnie    时间: 2004-06-23 21:39
标题: out of memory :killed process
假如是程序占用了很多内存空间
如何释放呢?
作者: windflowers1976    时间: 2004-06-24 07:47
标题: out of memory :killed process
嵌入式编程,你要用“抠”的眼光去看待内存。

仔细检查代码,少些大数组,算法优化下,内存申请不用就释放,不需要的函数代码都删掉。

还是得靠经验,另外我提的建议你做了没有?
作者: soloarrow    时间: 2004-06-24 09:15
标题: out of memory :killed process
[quote]原帖由 "windflowers1976"]自己去监控下你的程序需要占多少内存空间。[/quote 发表:


老大,你是否应该对此多做一点解释?(可能还要考虑各个系统的差异)比如方法,步骤之类的。象我们这些菜鸟,平时都是靠感觉和一点点所谓的ps命令,可能这些还不太够;你指点一下迷津?




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2