做什么“肮脏的”和“居民”与虚拟记忆有关? [英] What do "Dirty" and "Resident" mean in relation to Virtual Memory?

查看:97
本文介绍了做什么“肮脏的”和“居民”与虚拟记忆有关?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我退出了我大学的CS课程......那么,对计算机科学有充分了解的人可以告诉我:与虚拟记忆有关的Dirty and Resident是什么意思? 而且,对于奖励积分,无论如何,虚拟内存到底是什么?我正在使用Instruments中的Allocations / VM Tracker工具来分析iOS应用程序。

I dropped out of the CS program at my university... So, can someone who has a full understanding of Computer Science please tell me: what is the meaning of Dirty and Resident, as relates to Virtual Memory? And, for bonus points, what the heck is Virtual Memory anyway? I am using the Allocations/VM Tracker tool in Instruments to analyze an iOS app.

* 提示 - 尝试解释,好像你正在和一个8岁的孩子或一个完全愚蠢的孩子说话。
谢谢大家。

*Hint - try to explain as if you were talking to an 8-year old kid or a complete imbecile. Thanks guys.

推荐答案

脏内存是内存已经被改变了 - 这是垃圾收集器的内存必须看,然后决定如何处理它。根据您构建数据结构的方式,可能会导致垃圾收集器将大量内存标记为脏,每个垃圾收集周期都需要比所需更长的时间。保持这个数字低意味着你的程序运行得更快,并且不太可能遇到明显的垃圾收集暂停。对于大多数人来说,这不是一个真正的问题。

"Dirty memory" is memory which has been changed somehow - that's memory which the garbage collector has to look at, and then decide what to do with it. Depending on how you build your data structures, you could cause the garbage collector to mark a lot of memory as dirty, having each garbage collection cycle take longer than required. Keeping this number low means your program will run faster, and will be less likely to experience noticeable garbage collection pauses. For most people, this is not really a concern.

驻留内存是当前加载到RAM中的内存 - 实际使用的内存。虽然您的应用程序可能需要在内存中跟踪许多不同的项目,但可能只需要在任何时间点访问一个小的子集。保持这个数字较低意味着您的应用程序具有较低的加载时间,可以很好地与其他应用程序配合使用,并降低内存耗尽的风险并在应用程序运行时崩溃。这可能是您应该注意的数字,大部分时间都是。

"Resident memory" is memory which is currently loaded into RAM - memory which is actually being used. While your application may require that a lot of different items be tracked in memory, it may only require a small subset be accessible at any point in time. Keeping this number low means your application has lower loading times, plays well with others, and reduces the risk you'll run out of memory and crash as your application is running. This is probably the number you should be paying attention to, most of the time.

虚拟内存是您的应用程序跟踪的数据总量任何时间点。此数字与正在使用的数字不同(正在使用的内容标记为常驻内存) - 系统将保留跟踪但您的应用程序未在实际内存之外使用的数据。例如,它可能会将其保存到磁盘。

"Virtual memory" is the total amount of data that your application is keeping track of at any point in time. This number is different from what is in active use (what's being used is marked as "Resident memory") - the system will keep data that's tracked but not used by your application somewhere other than actual memory. It might, for example, save it to disk.

这篇关于做什么“肮脏的”和“居民”与虚拟记忆有关?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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