各位大虾,请给我具体讲讲内存管理吧

解决方案 »

  1.   

    太大。
    具体你去下载一本windows核心编程看看吧
      

  2.   

    转贴:
    内存管理的概念 
     
    进程和内存空间
    进程: 一旦程序正在运行,它就叫进程,进程拥有它自己的内存,文件句柄及其他系统资源. Windows任务栏显示的是主窗口而不是进程,单个进程可能有几个主窗口,每个窗口都由它自己的线程支持.
    每个进程都具有它自己"私有"的4GB虚拟地址空间, 它包括:程序的EXE映像,所加载的任何非系统的DLL(包括MFC DLL),程序的全局数据,内丰映射文件等等.
    Windows95的进程地址空间
    在95中,只有地址空间最底部的2GB(0--0X7FFFFFFF)才是真正私有的,顶部的2GB对于所有的进程都是相同的,被所有的进程共享,它顶部的1GB包括Windows95内核,可执行程序,虚拟设备驱动程序(VxDs)和文件系统代码等,另外1GB存放Windows DLL, 内存映射文件.
    Windows NT进程地址空间
    NT进程只能访问其底部2GB地址空间,且其中最低的和最高的64KB不可访问.NT内核,执行程序及设备程序都驻留在顶部2GB之中.
    虚拟内存的工作方式
    一般分页存储,每一页为4KB,当使用一页时,占用物理内存,但物理地址你永远看不到,Intel微处理器可以有效地把一个32位虚拟地址映射为物理页以及在该页内的偏移量.每个进程都有它自己的分页表,芯片的CR3寄存器就保持指向当前运行的进程的目录页的指针,进程之间的切换只需要更新CR3即可.
    当我们试图访问一个不在当前RAM之中的页,将触发一个中断,Windows通过检查,如果内存引用是假的,就会得到我们常见的"页面错误",程序退出.否则就把该页从磁盘文件读入RAM中.  
    ----------------
    具体的,还是楼上说的,看看windows核心编程
      

  3.   

    This is very important part of OS ..u'd learn it via some books ...and do some programs to sense
      

  4.   


    Memory Management Topics (MFC)
    Home |  Overview |  How Do IThis group of articles describes how to take advantage of the general-purpose services of the Microsoft Foundation Class Library (MFC) related to memory management. Memory allocation can be divided into two main categories: frame allocations and heap allocations.One main difference between the two allocation techniques is that with frame allocation you typically work with the actual memory block itself, while with heap allocation you are always given a pointer to the memory block. Another major difference between the two schemes is that frame objects are automatically deleted, while heap objects must be explicitly deleted by the programmer.What do you want to know more about?
    Frame allocation
    Heap allocation
    Allocating memory for an array
    Allocating memory for a data structure
    Allocating memory for an object
    Resizable memory blocks 
      

  5.   

    u can get more via MSDN ...sorry ,I cannot paste so much  :)