[AC-1779] U/I objects not collected with GC. (memory leak?)
GitHub Issue | n/a |
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2013-04-03T22:41:57.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | android |
Reporter | TETSUYA |
Assignee | Mauro Parra-Miranda |
Created | 2012-11-06T08:58:22.000+0000 |
Updated | 2016-03-08T07:40:40.000+0000 |
Description
U/I objects that changed visibility after displayed (or in "postlayout" event) are not collected with GC.
I attached test code and pictures (object hisotgram in heap analyzed with MAT).
*histogram filterd with "^ti.*ui.*".
1) Start test code and open DDMS, select test code process and click "Update heap" button.
2) In Heap tab, click "Cause GC" button a few times.
3) Click "Dump HPROF file" button, and get object hisotgram with MAT. <- Objects#0 column
4) Click menu button in Android emulator, do "update!" command 5 times.
5) In Heap tab, click "Cause GC" button a few times.
6) Click "Dump HPROF file" button, and get object hisotgram with MAT. <- Objects#1 column
7) Click menu button in Android emulator, do "update!" command 5 times.
8) Repeat 10 times above (to Object#9).
pic01.png - attached test code's result.
pic02.png - attached test code + "commented out part" in "postlayout" event handler.
In addition, visibility changed with table's click handler, also increased memory allocation.
Attachments
JavaScript's garbage collection won't be activated unless the reference count reaches zero... so you actually need to be removing objects or setting them to null, not just changing the visibility.
Invalid issue.