memory footprint - 程序运行时的内存占用量
[转 作者:Longhan 略谈Memory Footprint的翻译http://note.ssreader.com/show_topic.asp?Topicid=58549&forumid=13]

前几天看到一位仁兄提供的一篇计算机英语短文的译文,觉得其中对Memory Footprint的译成“内存问题”觉得不是很恰当。今日有闲,遂作了一点小小的调查研究,才发现自己有点孤陋寡闻, 网上有该词的文章海了去了。好多篇都有Reduce Memory Footprint的字样,推敲了一下这些文章,觉得该词的含义大约是内存占用的意思。后来在一家网上高技术词典网站查到了FOOTPRINT的释义如下:

Definition for: footprint

The amount of desk space that an object takes up; a smaller computer has a smaller footprint and allows more room for other items on the desk

这儿虽然谈的是计算机在桌面上占据的空间,但冠以Memory,那么就可以推出谈的是内存的占用量。我们都知道,在保证功能和响应速度的前提下,计算机程序占用的内存越少越好,所以该文中,Memory Footprint Problem应指的是过度占用内存的问题。就以此就教于列位高人。

这哥们挺不错的,把这个术语解释的非常清楚了。其实不用自己推敲那么麻烦,this word is googlable.
http://en.wikipedia.org/wiki/Memory_footprint
我在维基百科上找到了这个的注解,当然是英文的
Memory footprint refers to the amount of main memory that a program uses or references while running.
This includes all sorts of active memory regions like code, static data sections (both initialized and uninitialized), heap, as well as all the stacks, plus memory required to hold any additional data structures, such as symbol tables, constant tables, debugging structures, open files, etc, that the program ever needs while executing and will be loaded at least once during the entire run.

memory page - 内存页
http://en.wikipedia.org/wiki/Memory_page
在谈到计算机虚拟内存的时候,页,内存页或者虚拟页指的是一块固定大小且物理连续的内存,当然在虚拟内存空间也是连续的。在下面两种情况中,一个内存页通常是最小的数据单位:
1. 操作系统为一个应用程序分配内存。
2. 主存和辅助存储器(如硬盘)之间的数据交换。
In a context of computer virtual memory, a page, memory page, or virtual page is a fixed-length block of main memory, that is contiguous in both physical memory addressing and virtual memory addressing. A page is usually a smallest unit of data for the following:

memory segment - 内存段
内存段来源于Intel x86寻址方式中有一种segment(16bit)+offset(4bit)的段式内存管理机制。这里指的是连续的一段内存,长度为2^16byte即64kilobyte.
这个很重要,因为VirtualAlloc函数每次reserve一块内存时都是以64K为单位的,即每次reserve一个内存段。
LPVOID VirtualAlloc(
  LPVOID lpAddress,
  DWORD dwSize,
  DWORD flAllocationType,
  DWORD flProtect
);
lpAddress
[in] Long pointer to the specified starting address of the region to be allocated.
If the memory is being reserved, the specified address is rounded down to the next 64-KB boundary.
If the memory is reserved and is being committed, the address is rounded down to the next page boundary.
To determine the size of a page on the host computer, use the GetSystemInfo function.
If this parameter is NULL, the system determines where to allocate the region.


2GB per process 每个进程最多可以管理2GB内存
为什么是2GB呢,32位操作系统不是最多可以访问4GB内存吗?这个可能是最常见的问题。我们经常说的32位处理器最多访问4GB内存指的是处理器总线的直接寻址能力。32位总线可以对应4GB的存储单元(0/1)。操作系统可以有多种寻址方式,对于32位操作系统,寻址范围远远超过4GB。
但为什么是2GB per process呢,这是windows的设置,每个进程最多拥有4GB的内存空间,不过高位的2GB是kernal模式,由操作系统直接管理的,地位的2GB才是给用户操作的。

3GB per process 每个进程最多可以管理3GB内存
。。。这是因为2GB内存满足不了日益庞大的window程序,微软推出了3GB模式,需要在配置boot.ini文件。允许每个进程最多操作3GB的内存。如要求更多,请使用64位操作系统。
(未完待续)

 posted on 2009-08-19 22:49  Kratos  阅读(856)  评论(0)    收藏  举报