当前位置: 技术问答>linux和unix
程序崩溃:提示Out of Memory: Killed process 401 (ttycmd_b).
来源: 互联网 发布时间:2016-09-27
本文导语: 运行arm-linux版本:2.4.21-rmk1-crus1.4.3 程序被关闭时提示: Mono, 44100 hz, 48 Kbps Frame discarded! [ 0]Frame discarded! [ 0]Frame...
运行arm-linux版本:2.4.21-rmk1-crus1.4.3
程序被关闭时提示:
Mono, 44100 hz, 48 Kbps
Frame discarded!
[ 0]Frame discarded!
[ 0]Frame discarded!
[ 0]Out of Memory: Killed process 400 (ttycmd_b).
Out of Memory: Killed process 401 (ttycmd_b).
Out of Memory: Killed process 402 (ttycmd_b).
错误说明是内存不足,导致关闭进程。
所以使用cat /proc/meminfo查看内存信息:
1.开机不执行程序显示内存大小
total: used: free: shared: buffers: cached:
Mem: 14868480 10915840 3952640 0 122880 8081408
Swap: 0 0 0
MemTotal: 14520 kB
MemFree: 3860 kB
MemShared: 0 kB
Buffers: 120 kB
Cached: 7892 kB
SwapCached: 0 kB
Active: 1016 kB
Inactive: 7644 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 14520 kB
LowFree: 3860 kB
SwapTotal: 0 kB
SwapFree: 0 kB
2.执行程序后显示内存大小,也是程序被杀死时内存大小
total: used: free: shared: buffers: cached:
Mem: 14868480 13373440 1495040 0 139264 7942144
Swap: 0 0 0
MemTotal: 14520 kB
MemFree: 1460 kB
MemShared: 0 kB
Buffers: 136 kB
Cached: 7756 kB
SwapCached: 0 kB
Active: 6216 kB
Inactive: 3220 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 14520 kB
LowFree: 1460 kB
SwapTotal: 0 kB
SwapFree: 0 kB
3.此时执行top查看内存使用率
PID USER STATUS RSS PPID %CPU %MEM COMMAND
169 root R 1240 168 55.4 8.5 playmp3
102 root R 644 73 3.8 4.4 gprs
351 root S 440 73 1.9 3.0 ttycmd
4 root SW 0 1 1.9 0.0 kswapd
321 root R 688 41 1.5 4.7 top
101 root S 564 73 0.9 3.8 gpsrec
105 root S 564 104 0.1 3.8 gpsrec
22 root S 460 1 0.1 3.1 klogd
41 root S 568 1 0.0 3.9 sh
104 root S 564 101 0.0 3.8 gpsrec
118 root S 560 1 0.0 3.8 pppd
30 root S 496 1 0.0 3.4 inetd
20 root S 472 1 0.0 3.2 syslogd
1 root S 468 0 0.0 3.2 init
32 root S 464 1 0.0 3.1 crond
168 root S 388 1 0.0 2.6 sh
73 root S 368 41 0.0 2.5 main0
18 root SWN 0 1 0.0 0.0 jffs2_gcd_mtd4
6 root SW 0 1 0.0 0.0 kupdated
合计: 57.6
从上面信息来说,在程序被系统杀死时,内存还有1460KB大小,也就是说剩余内存还足够多,但为什么还会杀死程序呢。
而且我们通过top也可以看到内存使用率也只有57.6%,也还没达到100%。
但为什么系统还会杀死进程来释放内存呢,不解啊。。
程序被关闭时提示:
Mono, 44100 hz, 48 Kbps
Frame discarded!
[ 0]Frame discarded!
[ 0]Frame discarded!
[ 0]Out of Memory: Killed process 400 (ttycmd_b).
Out of Memory: Killed process 401 (ttycmd_b).
Out of Memory: Killed process 402 (ttycmd_b).
错误说明是内存不足,导致关闭进程。
所以使用cat /proc/meminfo查看内存信息:
1.开机不执行程序显示内存大小
total: used: free: shared: buffers: cached:
Mem: 14868480 10915840 3952640 0 122880 8081408
Swap: 0 0 0
MemTotal: 14520 kB
MemFree: 3860 kB
MemShared: 0 kB
Buffers: 120 kB
Cached: 7892 kB
SwapCached: 0 kB
Active: 1016 kB
Inactive: 7644 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 14520 kB
LowFree: 3860 kB
SwapTotal: 0 kB
SwapFree: 0 kB
2.执行程序后显示内存大小,也是程序被杀死时内存大小
total: used: free: shared: buffers: cached:
Mem: 14868480 13373440 1495040 0 139264 7942144
Swap: 0 0 0
MemTotal: 14520 kB
MemFree: 1460 kB
MemShared: 0 kB
Buffers: 136 kB
Cached: 7756 kB
SwapCached: 0 kB
Active: 6216 kB
Inactive: 3220 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 14520 kB
LowFree: 1460 kB
SwapTotal: 0 kB
SwapFree: 0 kB
3.此时执行top查看内存使用率
PID USER STATUS RSS PPID %CPU %MEM COMMAND
169 root R 1240 168 55.4 8.5 playmp3
102 root R 644 73 3.8 4.4 gprs
351 root S 440 73 1.9 3.0 ttycmd
4 root SW 0 1 1.9 0.0 kswapd
321 root R 688 41 1.5 4.7 top
101 root S 564 73 0.9 3.8 gpsrec
105 root S 564 104 0.1 3.8 gpsrec
22 root S 460 1 0.1 3.1 klogd
41 root S 568 1 0.0 3.9 sh
104 root S 564 101 0.0 3.8 gpsrec
118 root S 560 1 0.0 3.8 pppd
30 root S 496 1 0.0 3.4 inetd
20 root S 472 1 0.0 3.2 syslogd
1 root S 468 0 0.0 3.2 init
32 root S 464 1 0.0 3.1 crond
168 root S 388 1 0.0 2.6 sh
73 root S 368 41 0.0 2.5 main0
18 root SWN 0 1 0.0 0.0 jffs2_gcd_mtd4
6 root SW 0 1 0.0 0.0 kupdated
合计: 57.6
从上面信息来说,在程序被系统杀死时,内存还有1460KB大小,也就是说剩余内存还足够多,但为什么还会杀死程序呢。
而且我们通过top也可以看到内存使用率也只有57.6%,也还没达到100%。
但为什么系统还会杀死进程来释放内存呢,不解啊。。
|
1、你的这些数据是在崩溃的那一瞬间的数据吗?
2、是不是你的程序需要申请大于1460KB的内存?
2、是不是你的程序需要申请大于1460KB的内存?