{"number":55,"pull_request":{"number":55,"issue_url":"https://github.com/phonegap/phonegap-blackberry-webworks/issues/55","head":{"repo":{"master_branch":null,"name":"phonegap-blackberry-webworks","created_at":"2011-01-17T22:25:54Z","size":108,"clone_url":"https://github.com/filmaj/phonegap-blackberry-webworks.git","private":false,"updated_at":"2011-10-20T21:36:50Z","watchers":1,"ssh_url":"git@github.com:filmaj/phonegap-blackberry-webworks.git","url":"https://api.github.com/repos/filmaj/phonegap-blackberry-webworks","git_url":"git://github.com/filmaj/phonegap-blackberry-webworks.git","language":"Java","fork":true,"svn_url":"https://svn.github.com/filmaj/phonegap-blackberry-webworks","id":1265112,"pushed_at":"2011-10-20T21:36:50Z","open_issues":0,"homepage":"http://www.phonegap.com","description":"PhoneGap framework for BlackBerry 5 and 6. It is built using the WebWorks SDK.","forks":0,"html_url":"https://github.com/filmaj/phonegap-blackberry-webworks","owner":{"avatar_url":"https://secure.gravatar.com/avatar/82d945860586e7591638b1385f18c4bd?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"82d945860586e7591638b1385f18c4bd","url":"https://api.github.com/users/filmaj","id":52645,"login":"filmaj"}},"label":"filmaj:memleak","sha":"f2bf3dbef442618c12168b66f2e32f6de1d710eb","ref":"memleak","user":{"avatar_url":"https://secure.gravatar.com/avatar/82d945860586e7591638b1385f18c4bd?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"82d945860586e7591638b1385f18c4bd","url":"https://api.github.com/users/filmaj","id":52645,"login":"filmaj"}},"merged_by":null,"created_at":"2011-10-20T21:43:27Z","changed_files":1,"merged":false,"body":"First, I noticed an issue with a client application on BlackBerry. When I would load the app, close it, and then load it again, a dialog would come up saying \"previous instance still active, memory leak reported\" or something along those lines.\r\n\r\nGoogling some returned this thread:\r\n\r\nhttp://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Device-memory-is-Low-issue-for-an-WebWork-app/m-p/1217127/message-uid/1217127/highlight/true#U1217127\r\n\r\nIn this thread @tneil goes into details about how in certain cases WebWorks will not release the application. @tneil also describes a way to try to prevent this from occurring, by using weak references when keeping references to the `BrowserField` object. He also updates everyone on the thread about how the next WebWorks update should include fixes that alleviate this problem.\r\n\r\nIn order to bring this solution back into PhoneGap, we need to do two things:\r\n\r\n1. Merge in this pull request :) it contains the code changes originally suggested by @tneil, basically wrapping any references to the `BrowserField` object inside a `WeakReference` container object.\r\n2. You have to make sure you update the WebWorks SDK you are running to at least version 2.2.\r\n\r\nI also would like to start discussion regarding documenting this issue. Is this something we should potentially add to the README? Please chime in if you have an opinion on this.\r\n\r\nOther than that, I think the only thing left is to give props to @tneil. That guy's a monster!","comments":0,"title":"Fixed memory leak in PhoneGap apps","additions":23,"diff_url":"https://github.com/phonegap/phonegap-blackberry-webworks/pull/55.diff","updated_at":"2011-10-20T21:43:27Z","url":"https://api.github.com/repos/phonegap/phonegap-blackberry-webworks/pulls/55","id":420306,"patch_url":"https://github.com/phonegap/phonegap-blackberry-webworks/pull/55.patch","mergeable":null,"merged_at":null,"commits":2,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/82d945860586e7591638b1385f18c4bd?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"82d945860586e7591638b1385f18c4bd","url":"https://api.github.com/users/filmaj","id":52645,"login":"filmaj"},"deletions":12,"html_url":"https://github.com/phonegap/phonegap-blackberry-webworks/pull/55","base":{"repo":{"master_branch":null,"name":"phonegap-blackberry-webworks","created_at":"2011-01-17T22:04:34Z","size":276,"clone_url":"https://github.com/phonegap/phonegap-blackberry-webworks.git","private":false,"updated_at":"2011-10-15T00:26:21Z","watchers":41,"ssh_url":"git@github.com:phonegap/phonegap-blackberry-webworks.git","url":"https://api.github.com/repos/phonegap/phonegap-blackberry-webworks","git_url":"git://github.com/phonegap/phonegap-blackberry-webworks.git","language":"Java","fork":false,"svn_url":"https://svn.github.com/phonegap/phonegap-blackberry-webworks","id":1265043,"pushed_at":"2011-10-15T00:26:16Z","open_issues":9,"homepage":"http://www.phonegap.com","description":"PhoneGap framework for BlackBerry 5 and 6. It is built using the WebWorks SDK.","forks":22,"html_url":"https://github.com/phonegap/phonegap-blackberry-webworks","owner":{"avatar_url":"https://secure.gravatar.com/avatar/ec2720c4cc8bec1c6e1d5187b0d64128?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"ec2720c4cc8bec1c6e1d5187b0d64128","url":"https://api.github.com/users/phonegap","id":60365,"login":"phonegap"}},"label":"phonegap:master","sha":"8caf6193b2b4ed9b59e6bce6eca79777e8582d21","ref":"master","user":{"avatar_url":"https://secure.gravatar.com/avatar/ec2720c4cc8bec1c6e1d5187b0d64128?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"ec2720c4cc8bec1c6e1d5187b0d64128","url":"https://api.github.com/users/phonegap","id":60365,"login":"phonegap"}},"state":"open"},"action":"opened"}