{ "id": "62073", "key": "TIMOB-1441", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-05-16T11:06:47.000+0000", "created": "2011-04-15T02:52:32.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "ios", "klist", "memory", "rplist", "scrollableview" ], "versions": [], "issuelinks": [], "assignee": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2011-05-16T11:06:47.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}

Hello. I investigated the memory leak issue. I have such code\n(modified KitchenSink):
\nvar scrollView = Titanium.UI.createScrollableView({

\n
\nviews:[],\nshowPagingControl:true,\npagingControlHeight:30,\nmaxZoomScale:2.0,\ncurrentPage:1,\n
\n

});

\n

var dir =\nTitanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory+'/hires');

\n

var files = dir.getDirectoryListing();

\n

for(i=0;i<files.length;i++)
\n{

\n
\nvar img = Titanium.UI.createImageView({\n    backgroundImage:'../hires/'+files[i],\n    width:640,\n    height:880,\n    left:0,\n    top:0,\n});\n\nvar scroll = Titanium.UI.createScrollView({\n    contentWidth:320,\n    contentHeight:440,\n    minZoomScale:0.5,\n});\n\nscroll.add(img);\n\nscrollView.addView(scroll);\n
\n

}

\n

win.add(scrollView);
\nSo I noticed that every Scroll event free memory decreased by\n2-3MB, looks like Titanium creates new view for current focused\nview and there is NO way to release the memory. I don't understand\nwhy memory consumes when I scroll to new view. All views already\nloaded in that For cycle. I have app crash after 7-8 scrolls on my\niPhone 3G. 1.3.0 SDK

{html}", "attachment": [ { "id": "17992", "filename": "archive.zip", "author": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "created": "2011-04-15T02:52:45.000+0000", "size": 15002790, "mimeType": "application/zip" }, { "id": "17991", "filename": "resources-2.zip", "author": { "name": "aleard", "key": "aleard", "displayName": "Alan Leard", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:34.000+0000", "size": 7931609, "mimeType": "application/zip" } ], "flagged": false, "summary": "scrollview memory leak", "creator": { "name": "vitalyvirulaine", "key": "vitalyvirulaine", "displayName": "Vitaly Virulaine", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "vitalyvirulaine", "key": "vitalyvirulaine", "displayName": "Vitaly Virulaine", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "125695", "author": { "name": "gero", "key": "gero", "displayName": "gero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I can confirm this behaviour. Further information:

\n\n

This is a show stopper for every App with a \"gallery\". Release:\n1.4.0 on iPhone 4.0.1.

{html}", "updateAuthor": { "name": "gero", "key": "gero", "displayName": "gero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:47.000+0000", "updated": "2011-04-15T02:52:47.000+0000" }, { "id": "125696", "author": { "name": "davidr.", "key": "davidr.", "displayName": "David R.", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Same problem here.

{html}", "updateAuthor": { "name": "davidr.", "key": "davidr.", "displayName": "David R.", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:48.000+0000", "updated": "2011-04-15T02:52:48.000+0000" }, { "id": "125697", "author": { "name": "davidr.", "key": "davidr.", "displayName": "David R.", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

The TiUIImageView.m is missing a [imageView release] at line\n308, I believe:

\n

\nhttp://github.com/appcelerator/titanium_mobile/blob/master/iphone/C...

{html}", "updateAuthor": { "name": "davidr.", "key": "davidr.", "displayName": "David R.", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:48.000+0000", "updated": "2011-04-15T02:52:48.000+0000" }, { "id": "125698", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Possibly already resolved by scrollview fixes to load/unload\nmemory. Requires R&D.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:48.000+0000", "updated": "2011-04-15T02:52:48.000+0000" }, { "id": "125699", "author": { "name": "aleard", "key": "aleard", "displayName": "Alan Leard", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

This issue may be causing the application to crash. See ticket\nreference: http://developer.appcelerator.com/helpdesk/view/73421

\n

Does not crash on iPhone 4. Does Crash on iPad and previous\nversions of iPhone. Does not crash on android.

\n

Use attached app to test.

{html}", "updateAuthor": { "name": "aleard", "key": "aleard", "displayName": "Alan Leard", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:49.000+0000", "updated": "2011-04-15T02:52:49.000+0000" }, { "id": "125700", "author": { "name": "bowman9991", "key": "bowman9991", "displayName": "bowman9991", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Same here. 20 images on the iPad in a scrollView crashes every\ntime, but iPhone works perfectly. Is a fix likely to make it into\n1.6?

{html}", "updateAuthor": { "name": "bowman9991", "key": "bowman9991", "displayName": "bowman9991", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:49.000+0000", "updated": "2011-04-15T02:52:49.000+0000" }, { "id": "125701", "author": { "name": "markoperutovic", "key": "markoperutovic", "displayName": "Marko Perutovic", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Any news? This is critical to me!

{html}", "updateAuthor": { "name": "markoperutovic", "key": "markoperutovic", "displayName": "Marko Perutovic", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:49.000+0000", "updated": "2011-04-15T02:52:49.000+0000" }, { "id": "125702", "author": { "name": "danielandre", "key": "danielandre", "displayName": "DanielAndre", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Same issue here. I am tired to run around this problem. The\nscrollableview is such a basic structure on an IPad. Please, i beg\nyou, change this priority to high.

{html}", "updateAuthor": { "name": "danielandre", "key": "danielandre", "displayName": "DanielAndre", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:51.000+0000", "updated": "2011-04-15T02:52:51.000+0000" }, { "id": "125703", "author": { "name": "danielandre", "key": "danielandre", "displayName": "DanielAndre", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Just to add some perspective. This bug is at least 8 months\nold.

\n

\nhttp://developer.appcelerator.com/question/46061/serious-memory-leak

{html}", "updateAuthor": { "name": "danielandre", "key": "danielandre", "displayName": "DanielAndre", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:51.000+0000", "updated": "2011-04-15T02:52:51.000+0000" }, { "id": "125704", "author": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "body": "{html}

Traces / Instrument files here.

\n

Crash Log and Console Log:
\nhttp://pastie.org/1618663
\nhttp://pastie.org/1618660

{html}", "updateAuthor": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "created": "2011-04-15T02:52:52.000+0000", "updated": "2011-04-15T02:52:52.000+0000" }, { "id": "125705", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

There's another HD ticket for this: http://developer.appcelerator.com/helpdesk/view/64751

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:52.000+0000", "updated": "2011-04-15T02:52:52.000+0000" }, { "id": "125706", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [01937daa0e8379bb256b7b5d1e5a9ce675df397d])\n[#1441 state:fixed-in-qa] Scollable view now\nunloads offscreen views. \nhttps://github.com/appcelerator/titanium_mobile/commit/01937daa0e83...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:53.000+0000", "updated": "2011-04-15T02:52:53.000+0000" }, { "id": "125707", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [d000310a5b15c8cc03033617398835732178879d])\n[#1441] Add adjustable caching to allow rendering\nperformance/memory tradeoff. Sometimes the end dev knows best!\n\nhttps://github.com/appcelerator/titanium_mobile/commit/d000310a5b15...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:53.000+0000", "updated": "2011-04-15T02:52:53.000+0000" }, { "id": "125708", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [beb41c2c62bf67aac4d990b1d6e61dc31679724f])\n[#1441] Fix for senseless caching values. Hat tip\nto Blain. \nhttps://github.com/appcelerator/titanium_mobile/commit/beb41c2c62bf...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:53.000+0000", "updated": "2011-04-15T02:52:53.000+0000" }, { "id": "125709", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [757143515c9fef46bda05f0a703b179dd360ff66])\n[#1441] When clearing the views array, actually\ndeallocate the views \nhttps://github.com/appcelerator/titanium_mobile/commit/757143515c9f...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:53.000+0000", "updated": "2011-04-15T02:52:53.000+0000" }, { "id": "125710", "author": { "name": "reneaavik", "key": "reneaavik", "displayName": "Rene Aavik", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Hi,

\n

I don't think the issue is completely fixed. I am still\nexperiencing app crashing when scrolling through a decent number\nnumber of hi-res images (necessary for my magazine app). Possibly a\nmore fundamental issue with Titanium's garbage collecting\nroutines?

{html}", "updateAuthor": { "name": "reneaavik", "key": "reneaavik", "displayName": "Rene Aavik", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:54.000+0000", "updated": "2011-04-15T02:52:54.000+0000" }, { "id": "125711", "author": { "name": "reneaavik", "key": "reneaavik", "displayName": "Rene Aavik", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I did some additional testing and here's what I discovered:

\n\n

I think the GC system Titanium uses for iOS apps needs some\nmajor improvements, and this is critical, as these issues make\nTitanium largely unusable for many times of projects.\nUnfortunately, I discovered this way too late (after investing more\nthan a month of my time into a project that is almost complete, but\nstill completely useless due to these memory issues).

\n

Developers working on this - please advise when you expect those\nmajor issues to be fixed? I realize the memory issues are scheduled\nfor the 1.7.0 release, but I for one cannot afford to wait a couple\nof months on this, as I'm sure holds true to many others. I would\neven be willing to chip in on the development process to accelerate\nthis, even though I am pretty new to Obj-C myself.

{html}", "updateAuthor": { "name": "reneaavik", "key": "reneaavik", "displayName": "Rene Aavik", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:54.000+0000", "updated": "2011-04-15T02:52:54.000+0000" }, { "id": "125712", "author": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

renx - I agree this is not fixed...we are experiencing the same\nissues with the latest build for 1.7. Also this is even worse with\ntable views that have a lot of images...big showstoppers.

{html}", "updateAuthor": { "name": "brian", "key": "brian", "displayName": "Brian", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:54.000+0000", "updated": "2011-04-15T02:52:54.000+0000" }, { "id": "125713", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

We will be unable to address these specific issues without\nsample code.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:54.000+0000", "updated": "2011-04-15T02:52:54.000+0000" }, { "id": "125714", "author": { "name": "reneaavik", "key": "reneaavik", "displayName": "Rene Aavik", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I'm sorry, I should have posted the sample code. I also forgot\nto specify, that my ScrollableView does not consist of pure\nImageViews, but instead of Views containing\nImageViews (this is because my design requires there to be two\nimages side-by-side in landscape view).

\n

However, it looks like memory is now being correctly released in\nthe latest build of 1.7.0. I suspect the following commit did the\ntrick:

\n

\nhttps://github.com/appcelerator/titanium_mobile/commit/b2209783baae...

\n

as it seems to correct to properly detach all child views of a\nview being detached. This probably fixes this for situations where\nImageViews are used as children in the ScrollableView.views\narray.

\n

I will do some additional testing on device and report back with\nsample code if I discover additional problems in this regard,\nhowever, for now it seems the memory leak issue has been fixed.

{html}", "updateAuthor": { "name": "reneaavik", "key": "reneaavik", "displayName": "Rene Aavik", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:55.000+0000", "updated": "2011-04-15T02:52:55.000+0000" }, { "id": "125715", "author": { "name": "kevin(wa)", "key": "kevin(wa)", "displayName": "Kevin (WA)", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Forgive me, but how are you downloading \"the latest build of\n1.7.0\" ? I only see the latest nightly/continuous build here:\nhttp://builds.appcelerator.com.s3.amazonaws.com/index.html

{html}", "updateAuthor": { "name": "kevin(wa)", "key": "kevin(wa)", "displayName": "Kevin (WA)", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:55.000+0000", "updated": "2011-04-15T02:52:55.000+0000" }, { "id": "125716", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

You are able to download and build from our github repository:\nhttp://github.com/appcelerator/titanium_mobile.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:55.000+0000", "updated": "2011-04-15T02:52:55.000+0000" }, { "id": "125717", "author": { "name": "kevin(wa)", "key": "kevin(wa)", "displayName": "Kevin (WA)", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

ok, is the github \"master\" branch considered 1.7.0-continuous at\nthe moment?

{html}", "updateAuthor": { "name": "kevin(wa)", "key": "kevin(wa)", "displayName": "Kevin (WA)", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:55.000+0000", "updated": "2011-04-15T02:52:55.000+0000" }, { "id": "125718", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Yes. Master is the latest and should be considered unstable and\nnot generally suitable for release software, unless you absolutely\nrequire fixes from it.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:52:55.000+0000", "updated": "2011-04-15T02:52:55.000+0000" }, { "id": "133466", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[INFO] Titanium SDK version: 1.7.0 (05/10/11 19:34 879871b...), ipad1 4.2. 3 minutes an a ton of scrolls, not a leak seen using instruments.", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-05-11T16:49:07.000+0000", "updated": "2011-05-11T16:49:07.000+0000" } ], "maxResults": 25, "total": 25, "startAt": 0 } } }