[TIMOB-1441] scrollview memory leak
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-05-16T11:06:47.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.7.0 |
Components | iOS |
Labels | ios, klist, memory, rplist, scrollableview |
Reporter | Vitaly Virulaine |
Assignee | Pedro Enrique |
Created | 2011-04-15T02:52:32.000+0000 |
Updated | 2011-05-16T11:06:47.000+0000 |
Description
Hello. I investigated the memory leak issue. I have such code
(modified KitchenSink):
var scrollView = Titanium.UI.createScrollableView({
views:[],
showPagingControl:true,
pagingControlHeight:30,
maxZoomScale:2.0,
currentPage:1,
});
var dir =
Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory+'/hires');
var files = dir.getDirectoryListing();
for(i=0;i<files.length;i++)
{
var img = Titanium.UI.createImageView({
backgroundImage:'../hires/'+files[i],
width:640,
height:880,
left:0,
top:0,
});
var scroll = Titanium.UI.createScrollView({
contentWidth:320,
contentHeight:440,
minZoomScale:0.5,
});
scroll.add(img);
scrollView.addView(scroll);
}
win.add(scrollView);
So I noticed that every Scroll event free memory decreased by
2-3MB, looks like Titanium creates new view for current focused
view and there is NO way to release the memory. I don't understand
why memory consumes when I scroll to new view. All views already
loaded in that For cycle. I have app crash after 7-8 scrolls on my
iPhone 3G. 1.3.0 SDK
Attachments
File | Date | Size |
---|---|---|
archive.zip | 2011-04-15T02:52:45.000+0000 | 15002790 |
resources-2.zip | 2011-04-15T02:52:34.000+0000 | 7931609 |