首页 > Linux操作系统 > Linux操作系统 > RAM Memory and the Swap Disk

RAM Memory and the Swap Disk

原创 Linux操作系统 作者:v_fantasy 时间:2009-04-13 23:29:52 0 删除 编辑


Now that we know the amount of RAM on our server, we are ready to investigate the RAM and swap disk usage for the Oracle server. Whenever the memory demands of the server exceed that amount of RAM, the virtual memory facility is invoked. With virtual memory, segments of RAM are moved onto a special disk segment called the swap disk. The swap disk is a special segment of disk defined by the systems administrator to hold excess RAM memory contents. The virtual memory system commonly pages-out memory segments, and this is not an indicator of a memory problem. However, a page-in operation indicates that the server has exceeded the amount of available RAM and is recalling memory segments from the swap disk (see Figure 5-4).

Figure 5-26: RAM memory paging from the swap disk

Swapping (pi) slows down a server because it takes a large amount of time to copy memory segments from the swap disk back into RAM. On an Oracle database server, the solution to a page-in problem involves:

  • Smaller SGA Reduce the demand for RAM by making the SGA smaller. The SGA can be made smaller by reducing the db_block_buffers on Oracle8i and earlier versions, db_cache_size, sga_max_size, db_xK_cache_size on Oracle9i or shared_pool_size or java_pool_size init.ora parameters.

  • More RAM memory Add additional RAM memory to the server. (Remember that some 32-bit versions of Oracle cannot use more than 1.7GB of RAM.)

  • Reduce RAM demand Reduce RAM consumption of a database server by reducing the demands on Program Global Area (PGA) memory. Oracle parameters such as sort_area_size can greatly increase the amount of RAM allocated to each connected user's PGA.

A memory-bound database server always experiences paging from the swap disk. This is displayed in the vmstat utility as the po (page-out) and pi (page-in) columns of vmstat. Here we see that the database server is experiencing five page-in and nine page-out operations. You can tell that a server is having excessive memory requests by looking at page-in operations.

L 5-18

Root> vmstat 1 2

kthr     memory             page              faults        cpu    
----- ----------- ------------------------ ------------ -----------
r  b   avm   fre  re  pi  po  fr   sr  cy  in   sy  cs us sy id wa
0  0 218094   166   0  4   0   4   16   0 202  301 211 14 19 45 22
0  0 218094   166   0  5   9   4   14   0 202  301 211 14 19 45 22

In sum, page-out (po) operations are a normal part of virtual memory operation, but page-in (pi) operations indicate that the server has excessive RAM demands. Now let's take a look at a vmstat metric that is sometimes associated with a disk I/O bottleneck.

来自 “ ITPUB博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。



  • 博文量
  • 访问量