|
问题1
当前运行的程序是svn里提供的rtgui测试程序
测试流程就是:显示第1页->list_mem()->显示第2页->list_mem()->显示第3页->list_mem()->.........
请看finsh输出的信息
SystemInit......
\ | /
- RT - Thread Operating System
/ | \ 0.4.0 build Dec 1 2010
2006 - 2009 Copyright by rt-thread team
File System initialized!
LCD Device ID : 9320 finsh>>event size: 28
event size: 20
list_mem()
total memory: 53464
used memory : 34660
maximum allocated memory: 43360
32, 0x00000020
finsh>>list_mem()
total memory: 53464
used memory : 35016
maximum allocated memory: 43360
32, 0x00000020
finsh>>list_mem()
total memory: 53464
used memory : 35428
maximum allocated memory: 43360
32, 0x00000020
finsh>>list_mem()
total memory: 53464
used memory : 35720
maximum allocated memory: 43360
32, 0x00000020
finsh>>list_mem()
total memory: 53464
used memory : 36060
maximum allocated memory: 43360
32, 0x00000020
finsh>>list_mem()
total memory: 53464
used memory : 36352
maximum allocated memory: 43360
32, 0x00000020
finsh>>list_mem()
total memory: 53464
used memory : 36644
maximum allocated memory: 43360
32, 0x00000020
finsh>>list_mem()
total memory: 53464
used memory : 37348
maximum allocated memory: 43360
32, 0x00000020
finsh>>list_mem()
total memory: 53464
used memory : 37640
maximum allocated memory: 43360
32, 0x00000020
finsh>>list_mem()
total memory: 53464
used memory : 37836
maximum allocated memory: 43360
32, 0x00000020
finsh>>list_mem()
total memory: 53464
used memory : 38692
maximum allocated memory: 43360
32, 0x00000020
finsh>>list_mem()
total memory: 53464
used memory : 38888
maximum allocated memory: 43360
32, 0x00000020
finsh>>list_mem()
total memory: 53464
used memory : 39180
maximum allocated memory: 43360
32, 0x00000020
finsh>>
可以看出内存消耗是一直上涨的,此时执行测试(不断按上一页):显示第n页->list_mem()->显示第n-1页->list_mem()->显示第n-2页->list_mem()->.....
finsh>>list_mem()
total memory: 53464
used memory : 39180
maximum allocated memory: 43360
32, 0x00000020
finsh>>list_mem()
total memory: 53464
used memory : 39180
maximum allocated memory: 43360
32, 0x00000020
finsh>>list_mem()
total memory: 53464
used memory : 39180
maximum allocated memory: 43360
32, 0x00000020
finsh>>
可以看出内存使用并没有变化,通过上面测试是不是可以认为:显示过的页面并没有释放资源,导致内存使用不断增多
那么这样的话,如果有很多页,用户点下去早晚要崩溃。
///////////////////////////////////////// 问题2 /////////////////////////////////////////////////////
filelistview控件修正了之前销毁时不能释放内存的bug,但是在使用中好像仍然有内存泄露问题
测试过程如下:
首先看当前内存使用情况:
finsh>>list_mem()
total memory: 53464
used memory : 40552
maximum allocated memory: 43360
32, 0x00000020
然后点击测试页面中的“open file”
finsh>>list_mem()
total memory: 53464
used memory : 45184
maximum allocated memory: 47096
32, 0x00000020
向下翻页后
finsh>>key_right
finsh>>list_mem()
total memory: 53464
used memory : 45580
maximum allocated memory: 47096
32, 0x00000020
再翻一页
finsh>>key_right
finsh>>list_mem()
total memory: 53464
used memory : 45860
maximum allocated memory: 47096
32, 0x00000020
向上翻页
finsh>>key_left
finsh>>list_mem()
total memory: 53464
used memory : 45972
maximum allocated memory: 47096
32, 0x00000020
再向上翻页
finsh>>key_left
finsh>>list_mem()
total memory: 53464
used memory : 46028
maximum allocated memory: 47096
32, 0x00000020
退出文件浏览
finsh>>list_mem()
total memory: 53464
used memory : 42120
maximum allocated memory: 47096
32, 0x00000020
可以看出中间翻页的时候内存急剧增长,导致多翻几次页面,系统就要崩溃。
还可以看出退出文件浏览后,系统内存比之前增长了2k,不知道为什么。
请老大们看看是不是确实存在问题:) |
阿莫论坛20周年了!感谢大家的支持与爱护!!
一只鸟敢站在脆弱的枝条上歇脚,它依仗的不是枝条不会断,而是自己有翅膀,会飞。
|