xw721xw
作者xw721xw·2013-06-20 16:26
系统架构师·北明软件

夯实基础之内存篇

字数 3253阅读 3249评论 0赞 2

Physical memory is a set of integrated circuits designed to store binary data. This storage has two characteristic properties: it is transient, as all stored information vanishes when electrical power is lost, and randomly accessible, meaning any bit can be accessed as fast as any other bit. In addition to physical memory, most systems implement virtual memory, which acts to manage physical memory and provide a simple interface to application developers. Virtual memory is consumed by the system kernel, filesystem caches, intimately shared memory, and processes.

物理内存是一套集成电路设计来存储二进制数据。此存储有两个特性:①它是短暂的,因为当断电时,所有存储的信息都会消失。②:随机访问,任何一点可以作为任何其他点的快速访问。除了物理内存,大多数系统实现虚拟内存:管理物理内存和提供给开发人员一个简单的界面。虚拟内存主要用于系统内核,文件系统缓存,共享内存消耗,进程。

交换空间的产生和定义

Memory performance begins to affect overall system performance in two instances. The first instance occurs when the system is unable to retrieve and store data from physical memory fast enough, or when the system is forced to travel to main memory frequently. This sort of problem can be attacked by tuning the algorithm that is responsible or by buying a system with faster access to main memory. The second, and more likely, case is that the demand for physical memory by all currently running applications, including the kernel, exceeds the available amount. The system is then forced to begin paging , or writing unused pieces of memory to disk. If the low memory condition worsens, the memory consumed by entire processes will be written to disk, which is called swapping .

内存性能在两种情况下开始受到影响。一:当系统不能够检索并且不能够存储来自物理内存中足够快的数据,或者是当系统被迫前往主存储器频繁时。这类问题可以通过调整算法,可以实现或者通过购买一个更快的内存去访问主存。二:或者更可能的是,所有正在运行的应用程序的物理内存的需求,包括内核,超过了可用的量。该系统然后被迫开始分页,或写存储器的未用部分磁盘。如果低内存条件恶化,整个过程所消耗的内存将被写入磁盘,这是所谓的交换。

[1]Memory conditions fall into four categories:

内存条件分为四类:

[1] Paging and swapping are often used interchangeably. However, they mean very different things in practice, so we'll be careful not to mix them.

分页和交换经常互换。然而,他们在实践中存在很多的不同,因此我们要提防不要讲他们混淆。

Sufficient memory is available, and the system performs optimally.

最够的内存可用,并且系统性能可以优化。

Memory is constrained (one likely culprit, especially on older Solaris systems, is the filesystem cache). Performance begins to suffer as the system attempts to scavenge memory that is not in active use.

内存约束(一个可能的原因,特别是对于老的solaris系统,是文件系统的缓存)。性能开始受到系统试图清除不主动使用的内存。

The system is legitimately short of memory. Performance suffers, especially on interactive processes.

系统只拥有短期的记忆,性能下降,特别是互动过程时。

 

Memory is critically scarce. Swapping begins to take place. System performance takes a heavy hit, and interactive performance becomes abysmal.

内存极为不足。交换开始起作用的时候。系统的性能是以沉重的打击,交互时,性能变得更糟糕。

 

 

In this chapter, I'll describe how memory is physically implemented, the mechanics of how the system manages memory, and how paging and swapping function at a system level. I'll give you some tools you can use to analyze your memory use, and explain how to work with swap space. Finally, I'll cover mechanisms to address some common memory performance problems.

 

 

在这一章中,我将描述如何内存的实现,系统如何管理内存的机制,以及如何分页和交换功能在系统水平。我会给你一些工具你可以用来分析你的内存使用,并解释如何使用交换空间。最后,我会掩护机制来解决一些常见的内存性能问题。

 

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

2

添加新评论0 条评论

Ctrl+Enter 发表
X社区推广