Xamarin Forms Profiler-真正的内存消耗是多少?规模增长总是积极的吗? [英] Xamarin forms profiler - what is the real memory consumption? Size Growth always positive?

查看:359
本文介绍了Xamarin Forms Profiler-真正的内存消耗是多少?规模增长总是积极的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出我的应用程序的实际消耗量,因为我创建了示例应用程序来观察事物.但是我无法理解xamarin分析器的结果.

I am trying to figure out real consumption of my app for that I created sample app to observe things. But I am not able to understand the results from xamarin profiler.

分配了1,5mb的内存,但是当我仅单击活动对象时,它显示了510kb.有什么区别?这是否意味着应用程序仅使用510kb,但通常分配了1.5mb?在更大的应用程序上,这种差异更为明显.在我的应用程序"中,当仅活动对象"为10mb时,我看到最大200mb的内存分配.这是巨大的差异.

below screenshot shows that memory allocated 1,5mb but when I click only live objects, it shows 510kb. What is the difference? Does it mean app is only using 510kb but in general allocated 1,5mb? on a larger app this difference is more significant. On my App I see memory allocation up to 200mb when Only live objects is 10mb. it is huge difference.

另一方面,xamarin说可以拍摄快照并比较差异.根据建议,我只是这样做,但结果对我来说并不明确.即使对象增长减少,大小增长也总是在增加.这是为什么?应用程序非常基本,共有2个页面,在将页面2弹出到页面1之后,将获取快照2到快照3.

On the other hand, xamarin says that take snapshots and compare differences. As advised, I did just like that but results are not clear for me. Size Growth is always increasing even Object Growth reduces. why is that? App is quite basic, there 2 pages, Snapshot 2 to Snapshot 3 is taken after popping page 2 to page 1. How can it be that size growth is increasing If I am popping a page?

更新:

此处是扩展问题.当我单击"Only Live Objects"(如图中所示)时,它显示已分配内存9,5mb".如果它们是活动对象,那么我理解这至少是托管代码当前的内存使用情况?是真的吗?

Extended question here. When I click "Only Live Objects" as shown in the image, it displays Memory Allocated 9,5mb. if they are live objects, I understand that this is the current memory usage by managed code at least? Is that true?

推荐答案

有什么区别?这是否意味着应用程序仅使用510kb,但通常分配了1.5mb?

What is the difference? Does it mean app is only using 510kb but in general allocated 1.5mb?

分配的对象是自应用程序启动(或重置)以来创建的所有对象.

Objects allocated are all objects that have been created since application start (or reset).

活动对象是垃圾回收器尚未回收的那些对象.这可能包括无法访问的对象,并且肯定会包括应用程序仍在使用的对象.

The live objects are those objects that haven't been reclaimed by the garbage collector. This may include objects that are unreachable, and will definitely include objects that are still in use by the application.

即使对象增长减少,大小增长也总是在增加.为什么呢?

Size Growth is always increasing even Object Growth reduces. why is that?

它的确一直在增加,但是我认为它没有与之前的快照进行比较,而是与基线进行了比较,这就是为什么它总是积极的.您可以尝试将这些Size Growth值与snapshot 1的值进行比较,如下图所示:

It did increasing all time, but I think it's not compared with the previous snapshot, it was compared with a baseline, that's why it always positive. You could try compare these Size Growth value with snapshot 1's value , as illustrated in the following diagram :

工作集:是指进程使用的总物理内存(RAM).您可以参考我的答案:

Working Set : refers to the total physical memory (RAM) used by the process. You could refer to my answer :

正常的内存RAM大小是多少?(xamarin )

这篇关于Xamarin Forms Profiler-真正的内存消耗是多少?规模增长总是积极的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆