简体   繁体   English

UiWebView Obj-C如何清理有泄漏的Javascript应用

[英]UiWebView Obj-C how to cleanup a Javascript app with leaks

My iPad app has a webview that contains an app written in jQuery. 我的iPad应用程序有一个Web视图,其中包含一个用jQuery编写的应用程序。 It is pretty heavy in that it loads Base64 strings from SQLite. 它从SQLite加载Base64字符串非常繁重。

In the Intstruments Allocations profiler the memory allocations keep increasing and only ever decreasing by miniscule amounts. 在Intstruments Allocations探查器中,内存分配保持增加,并且仅以很小的数量减少。

I am using the FMDB wrapper for SQLite and have written my own functions that init string so I can release them directly after sending to the UIWebView. 我正在为SQLite使用FMDB包装器,并编写了自己的初始化字符串的函数,因此在发送到UIWebView之后可以直接释放它们。 It hasn't helped the allocations count, so my next port of call is the WebView jQuery app. 它并没有帮助分配计数,因此我的下一个调用端口是WebView jQuery应用程序。

Since I haven't written the jQuery I don't know where to look. 由于我还没有编写jQuery,所以我不知道在哪里查找。

Is there a way that I can remove/release/flush the UIWebView and then re-create it and reload my web app? 有没有一种方法可以删除/释放/刷新UIWebView,然后重新创建它并重新加载我的Web应用程序?

Any ideas would be greatly appreciated. 任何想法将不胜感激。

Thanks. 谢谢。

Also I think its interesting to look at the google search API app in app store. 另外,我认为在应用商店中查看google search API应用也很有趣。 They are kind of using a web view but it works perfectly. 他们有点使用网络视图,但是效果很好。 Any ideas about that? 有什么想法吗?

Instead of theorising about what might be wrong, you can take the jQuery app out and use it in browser. 您可以将jQuery应用程序拿出来并在浏览器中使用,而不用对可能出问题的地方进行理论分析。 Use Chrome dev tools to check what the memory usages are and you can pinpoint leaks to pages more accurately. 使用Chrome开发者工具检查内存使用情况,然后可以更准确地查明页面泄漏。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM