Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jiapeng Xiu Chapter 3 Memory Management Chapter 3 Memory Management —— Solaris Memory Monitor.

Similar presentations


Presentation on theme: "Jiapeng Xiu Chapter 3 Memory Management Chapter 3 Memory Management —— Solaris Memory Monitor."— Presentation transcript:

1 Jiapeng Xiu media@bupt.edu.cn Chapter 3 Memory Management Chapter 3 Memory Management —— Solaris Memory Monitor

2 2 Outline  Quick Introduction to Memory Monitoring  Memory Monitoring Tools  The Vmstat Command  MemTool: Unbundled Memory Tools  Other Memory Tools

3 3 Quick Introduction to Memory Monitoring  Solaris memory is used for several major functions, including the kernel, processes, and the file system cache.  Solaris memory utilization is summarized,at the global level, the following categories:  Total physical memory available  Memory allocated internally within the Solaris kernel  Memory used for the file system page cache  Memory used by processes  Memory free

4 4 Several Solaris memory utilities  Total Physical Memory  Command: prtconf  #prtconf  Kernel Memory  Command: sar  # sar -k 1 1

5 5  Free Memory  Free memory is almost always zero because the buffer cache grows to consume free memory.  Command:vmstat  # vmstat 3  File System Caching Memory  The file system cache uses available free memory to cache files.  To look at the amount of file buffer cache, use the MemTool package.  Command:prtmem--summary of the buffer cache memory  #prtmem Several Solaris memory utilities(Cont.)

6 6  Memory Shortage Detection  To determine if there is a memory shortage.  Command:vmstat  Swap Space  Solaris swap space has two important states: swap reservation and physical swap allocation.  Two important measures of Solaris space: > The amount of virtual swap space that is configured and available for reservations. > The amount of physical swap space that is configured and available for physical page-outs. Several Solaris memory utilities(Cont.)

7 7  Virtual Swap Space  The amount of virtual swap space is the sum of the amount of physical swap space (disk swap space) plus the amount of memory that Solaris can use for swap.  Command:swap –s  #swap -s  Physical Swap Space  The amount of physical swap space configured is simply the amount of physical disk.  Command:swap –l Several Solaris memory utilities(Cont.)

8 8 Outline  Quick Introduction to Memory Monitoring  Memory Monitoring Tools  The Vmstat Command  MemTool: Unbundled Memory Tools  Other Memory Tools

9 9 Memory Monitoring Tools  Many Solaris tools can help us to understand the memory behavior, We have two basic objectives in looking at Solaris memory:  to find out where all of the memory is allocated.  to look at memory (or paging) activity.

10 10 Solaris Memory Monitoring Commands ToolLocation of ToolCapabilities for Memory Utilization Reporting Paging Activity Reporting vmstat/usr/binBasicSystem wide only ps/usr/binProcess size — swap/usr/binSwap allocation — wsmEngineering/freeWorking set size — ipcs/usr/binSysV shared memory — MemToolEngineering/downloadProcess/file system cache — memstatEngineering/downloadSame as vmstatBreakout of paging for file systems, applications, and libraries pmap/usr/proc/binProcess address map — pmap -x/usr/proc/binProcess physical memory utilization, including the amount of memory shared among processes — crash/usr/bin/crashKernel memory utilities — dbxSPARCworksMemory leaks —

11 11 Outline  Quick Introduction to Memory Monitoring  Memory Monitoring Tools  The Vmstat Command  MemTool: Unbundled Memory Tools  Other Memory Tools

12 12 The Vmstat Command  The Solaris vmstat utility summarizes various functions within the virtual memory system, including:  systemwide free memory  paging counters  disk activity  system calls  CPU utilization

13 13 The output of vmstat with explaination

14 14 Process Memory Usage, ps, and the pmap Command  The memory usage of a process can be categorized into two classes  Virtual memory usage  Physical memory usage  We refer to the physical memory usage of a process as its resident set size, often abbreviated RSS.  We can use the ps command to display a process's virtual and physical memory usage.

15 15 Process Memory Usage, ps, and the pmap Command (Cont.)  Example:  # ps -e -opid,vsz,rss,args  PID VSZ RSS COMMAND  11896 1040 736 ps -a -opid,vsz,rss,args  11892 1032 768 sh  3603 1032 768 sh  2695 1896 1432 telnet donan  2693 1920 1456 telnet donan  2433 1920 1440 telnet firefly  3143 1920 1456 telnet devnull  2429 1920 1440 telnet firefly.eng  2134 1920 1440 telnet devnull

16 16 Process Memory Usage, ps, and the pmap Command (Cont.)  The memory use is separated into three categories: Private, shared and partially shared.  The pmap command provides a mechanism for a detailed look at a process ’ s memory utilization.  how much memory is resident  how much of that is shared  how much private memory a process has

17 17 Outline  Quick Introduction to Memory Monitoring  Memory Monitoring Tools  The Vmstat Command  MemTool: Unbundled Memory Tools  Other Memory Tools

18 18 Unbundled Memory Tools  MemTool was developed to provide a more in-depth look at where memory has been allocated on a Solaris system.  Using these tools, we can find out where every page of memory is, and in what proportions.

19 19 MemTool Utilities The MemTool package provides command-line, GUI, and character tools, as listed in Table. ToolInterfaceDescription mempsCLIDumps process summary and file system cache memory (-m). prtmemCLIDisplays a systemwide summary of memory allocation. prtswapCLI Displays a systemwide detailed description of swap allocation. Both virtual and physical swap allocation are shown. memtoolGUIIs a comprehensive GUI for UFS and process memory. memCUIIs a Curses interface for UFS and process memory.

20 20 Command-Line Tools  System Memory Summary: prtmem  Show a systemwide summary of memory utilization, categorized into seven major groups.  # prtmem  Total memory: 241 Megabytes  Kernel Memory: 39 Megabytes  Application: 106 Megabytes  Executable & libs: 36 Megabytes  File Cache: 3 Megabytes  Free, file cache: 58 Megabytes  Free, free: 0 Megabytes

21 21 Command-Line Tools (Cont.)  File System Cache Memory: memps -m  Memtool provides a list showing where the pool of filesystem cache memory has been allocated, sorted by vnode.  # memps -m  SunOS devhome 5.7 SunOS_Development sun4u 02/08/100  00:23:12  Size E/F Filename  10232k E /export/ws/local/netscape/netscape  5648k E /export/ws/dist/share/framemaker,v5.5.3/bin/sunxm.s5.sparc/ maker5X.e  2944k F /home/rmc/.netscape/history.dat

22 22 Command-Line Tools (Cont.)  The prtswap utility shows the three main states of swap and the way in which that state affects the virtual and physical swap configured.

23 23 The MemTool GUI  The MemTool GUI provides an easy method for invoking most of the functionality of the MemTool command line interfaces. Invoke the GUI as the root user to see all of the process and file information.  The MemTool GUI offers three basic modes:  buffer cache memory  process memory  process/buffer cache mapping matrix.

24 24 The MemTool GUI (Cont.)  The initial screen shows the contents of the file system cache, including each entry in the UFS file system cache.  The second mode of the MemTool GUI is the process memory display which shows the process table with a memory summary for each process.  The process matrix shows the relationship between processes and mapped files. The matrix can be used to show the total memory usage of a group of processes.

25 25 Outline  Quick Introduction to Memory Monitoring  Memory Monitoring Tools  The Vmstat Command  MemTool: Unbundled Memory Tools  Other Memory Tools

26 26 The Workspace Monitor Utility: WSM  The wsm command is invoked against a single process.  It shows a live status of a processes memory map and lists the amount of memory that has been read or written to in the sampled interval.  This information is particularly useful for determining how much memory a process is using at any given instant.  # wsm -p 732 -t 10

27 27 An Extended vmstat Command: memstat  memstat shows the paging activity, page- ins, page-outs, and page-frees separated into three classes:  file system paging  anonymous memory paging  executable/shared library paging

28 28 An Extended vmstat Command: memstat (Cont.)

29 29 End Last.first@Sun.COM


Download ppt "Jiapeng Xiu Chapter 3 Memory Management Chapter 3 Memory Management —— Solaris Memory Monitor."

Similar presentations


Ads by Google