xamarin.forms知道android和ios的内存使用情况 [英] xamarin.forms know memory usage both for android and ios
问题描述
我正在尝试使用xamarin.forms开发android和iOS应用程序.并且已经完成了包括Canvas
图纸的主体部分.为此,我使用了Skiasharp
来对位图图像执行操作.
I am trying to develop android and iOS application using xamarin.forms. And already completed the main part that includes Canvas
drawing. For that, I have used Skiasharp
, to perform operations on bitmap images.
现在,在android中,
1.如果我尝试处置在出现SIGSEGV
致命错误之前初始化的位图. (我认为此问题不是特定于操作系统的)
2.当我连续运行我的应用程序20-22分钟时,应用程序突然崩溃.
Now, in android,
1. If I try to dispose bitmaps that I initialized before I get SIGSEGV
fatal error. (I think this issue is not OS specific)
2. When I continuously run my app for 20-22 minutes, app crashes suddenly.
在iOS中, 当我长时间运行我的应用程序时,我的iPhone挂死了.直到我从PC上的iFunBox卸载应用程序后,它才能开始.
And in iOS, my iphone gets hanged when I run my app for long time. And it doesn't start until I uninstall app from iFunBox in my pc.
我想问一下xamarin.forms或本机项目中是否有办法找出我的内存泄漏的地方. 我怎么知道目前实际使用了多少内存?
I wanted to ask if there are ways in xamarin.forms or in native projects to find out where my memory is leaking. How can I know how much memory of RAM is actually being used at the moment ?
谢谢
推荐答案
对于Android,您可以使用Android调试监视器工具.这是作为Android SDK的一部分安装的工具.
For Android, you can use the Android Debug Monitor tool. This is a tool that is installed as part of the Android SDK.
下面是更多信息的URL:
Below is the URL for more information:
https://www .codeproject.com/Articles/798462/Diagnosing-Memory-Usage-in-a-Xamarin-Android-Appli
对于iOS,您可以尝试使用本机XCode Instrument.
For iOS, you can try to use the native XCode Instrument.
下面是更多信息的URL:
Below is the URL for more information:
此外,以下是有关Xamarin.Forms内存管理的有用文章. 希望会对您有所帮助.
Also, Below is a useful article that talk about Xamarin.Forms Memory management. Hopefully it will be helpful.
https://igorelikblog.wordpress.com/2016/07/08/xamarin-form-memory-management/
这篇关于xamarin.forms知道android和ios的内存使用情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!