{"id":6661,"date":"2014-04-20T21:49:07","date_gmt":"2014-04-20T21:49:07","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/20\/strange-uiwebview-memory-usage-with-many-animations-collection-of-common-programming-errors\/"},"modified":"2014-04-20T21:49:07","modified_gmt":"2014-04-20T21:49:07","slug":"strange-uiwebview-memory-usage-with-many-animations-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/20\/strange-uiwebview-memory-usage-with-many-animations-collection-of-common-programming-errors\/","title":{"rendered":"Strange UIWebView memory usage with many animations-Collection of common programming errors"},"content":{"rendered":"<p>I am using UIWebView to display a page with tons of animations (around ~40 webkit keyframe animation, each of them with 40~70 keyframes). Most of the animations loops infinitely. The problem is, the app will crash around 30 seconds later after the page is displayed. And I tested that the app would crash in iPad 3 but not iPad 2. More strangely, I profiled the app and got this result:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/H9LMc.png\" \/><\/p>\n<p>The app&#8217;s free memory dropped suddenly (from 5xx MB to 1xx MB) within 5 seconds. But the used memory did not rise.<\/p>\n<p>The mostly increased memory came from <code>IOKit<\/code>, which allocated 100+ MB within the last 5 seconds. I don&#8217;t know why this is the case.<\/p>\n<p>The problem is: why the used memory does not increase while the free memory decreases dramatically?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am using UIWebView to display a page with tons of animations (around ~40 webkit keyframe animation, each of them with 40~70 keyframes). Most of the animations loops infinitely. The problem is, the app will crash around 30 seconds later after the page is displayed. And I tested that the app would crash in iPad [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6661","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6661"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6661\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}