{"action":"created","issue":{"url":"https://api.github.com/repos/readium/SDKLauncher-iOS/issues/48","labels_url":"https://api.github.com/repos/readium/SDKLauncher-iOS/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/readium/SDKLauncher-iOS/issues/48/comments","events_url":"https://api.github.com/repos/readium/SDKLauncher-iOS/issues/48/events","html_url":"https://github.com/readium/SDKLauncher-iOS/issues/48","id":59868458,"number":48,"title":"Unrecovered memory growth (leak?) when loading spine items.","user":{"login":"nodehack","id":887396,"avatar_url":"https://avatars.githubusercontent.com/u/887396?v=3","gravatar_id":"","url":"https://api.github.com/users/nodehack","html_url":"https://github.com/nodehack","followers_url":"https://api.github.com/users/nodehack/followers","following_url":"https://api.github.com/users/nodehack/following{/other_user}","gists_url":"https://api.github.com/users/nodehack/gists{/gist_id}","starred_url":"https://api.github.com/users/nodehack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodehack/subscriptions","organizations_url":"https://api.github.com/users/nodehack/orgs","repos_url":"https://api.github.com/users/nodehack/repos","events_url":"https://api.github.com/users/nodehack/events{/privacy}","received_events_url":"https://api.github.com/users/nodehack/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-04T21:55:02Z","updated_at":"2015-03-05T14:23:52Z","closed_at":null,"body":"Hi all.\r\nI'm writing an iOS application using the Readium SDK and associated JS/HTML/CSS and I started having issues with memory pressure.  It seems like each time readium loads a new spine item into the UIWebView there is a growth in WebCore purgeable data that is never \"purged\".  Sending low memory warnings does nothing to recover this memory.  So I decided to try this on the SDKLauncher-iOS itself to determine if it was possibly something I was doing wrong but the issue exists on the SDKLauncher as well.  When running on a device, memory pressure will eventually begin sending low memory warning to the application and then finally the application will crash with a memory error.\r\n\r\n## To Reproduce:\r\n* Goto: https://code.google.com/p/epub-samples/downloads/detail?name=accessible_epub_3-20121024.epub&can=2&q= \r\n* Download the Accessible ePub3 ebook.\r\n* Drag it onto the ePub group in Xcode (be sure to add it to the SDKLauncher target).\r\n* Run the SDKLauncher\r\n* Pick the accessible ePub3 epub from the list and load up a spine item.\r\n* Navigate around and notice each time the spine changes the memory increases. (This becomes very obvious when you navigate back and forth between 2 different spine items).\r\n\r\nYou can actually reproduce this issue with any of the supplied epubs with multiple spine items however the Accessible ePub3 book makes the issue more dramatic.\r\n\r\n###### Video demonstrating the issue:\r\nhttp://youtu.be/Y-NLc0xlTiQ"},"comment":{"url":"https://api.github.com/repos/readium/SDKLauncher-iOS/issues/comments/77371416","html_url":"https://github.com/readium/SDKLauncher-iOS/issues/48#issuecomment-77371416","issue_url":"https://api.github.com/repos/readium/SDKLauncher-iOS/issues/48","id":77371416,"user":{"login":"danielweck","id":625201,"avatar_url":"https://avatars.githubusercontent.com/u/625201?v=3","gravatar_id":"","url":"https://api.github.com/users/danielweck","html_url":"https://github.com/danielweck","followers_url":"https://api.github.com/users/danielweck/followers","following_url":"https://api.github.com/users/danielweck/following{/other_user}","gists_url":"https://api.github.com/users/danielweck/gists{/gist_id}","starred_url":"https://api.github.com/users/danielweck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielweck/subscriptions","organizations_url":"https://api.github.com/users/danielweck/orgs","repos_url":"https://api.github.com/users/danielweck/repos","events_url":"https://api.github.com/users/danielweck/events{/privacy}","received_events_url":"https://api.github.com/users/danielweck/received_events","type":"User","site_admin":false},"created_at":"2015-03-05T14:23:52Z","updated_at":"2015-03-05T14:23:52Z","body":"Hello @nodehack thank you for your detailed report.\r\nWhat iOS version? (hardware device, or emulator?)\r\n\r\nAt any rate, it sounds like you may be affected by either ; or all ; of these known bugs (ongoing investigation):\r\n\r\n1) LibXML parser -related memory leaks, Pull Request (you can try this to see if it fixes the problem you discovered):\r\nhttps://github.com/readium/readium-sdk/pull/161\r\n\r\n2) WebCore::RenderSVGRoot issue? (probably not, as this seems to be SVG specific):\r\nhttps://groups.google.com/d/msg/readium-dev/OiY2iOtpC58/WGlIofzgISwJ\r\nCC @remipraud\r\n\r\n3) UIWebview vs. WKWebView (apparently, the former leaks lots of memory, even iBooks crashes):\r\nhttps://groups.google.com/forum/#!msg/readium-dev/PQZDjeeNwsk/KfyxtNwPXnsJ\r\n\r\n"}}