{ "id": "64825", "key": "TIMOB-3748", "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": "11330", "description": "Planning Week", "name": "Sprint 2011-21", "archived": true, "released": true, "releaseDate": "2011-05-30" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-05-25T18:24:55.000+0000", "created": "2011-04-26T15:10:02.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" } ], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-05-25T19:11:03.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": "h1. The Problem\nsetInterval leaks objects (and memory) on iOS. Even without anything in it, this can still be observed.\n\nh2. Sample Code\nIf you are feeling particularly adventurous, lower the period of the below code to 1 instead of 30. It will increase the rate of the leak and slow your computer down a bit, but the same behavior can be observed at higher periods such as 30 or 200. I did not test on anything longer than 200.\n\n{code:javascript}\nfunction checkInterval() { }\nsetInterval(checkInterval, 30);\n{code}\n\nI ran the above code alone in an app.js using XCode's \"Profile\" > \"Allocations\" feature. It leaks at a rate of approximately 100 CFStrings, 100 CFDates, and 30ish KrollInvocations per second.\n\nh2. Associated Helpdesk Ticket\nThere isn't one. I noticed this in one of our co-dev apps.", "attachment": [], "flagged": false, "summary": "iOS: setInterval leaks CFStrings, CFDates and KrollInvocations", "creator": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": null, "comment": { "comments": [ { "id": "134262", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Timers, when running, keep the meter running on autorelease pools. This adds a new autorelease pool to stop that.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-05-25T12:11:58.000+0000", "updated": "2011-05-25T12:11:58.000+0000" }, { "id": "134306", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed with SDK build r364c307e. Verified leak prior to verifying fix. With fix memory allocation stayed stable on iOS 4.3.3 with iPhone 4. Closing.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-05-25T18:24:55.000+0000", "updated": "2011-05-25T18:24:55.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }