Updated: 11/4/97 1. Use 'ps -el' to investigate the memory status of the processes currently running on the system. Take special note of the SZ and RSS fields. What is the difference between SZ and RSS? Which value is bigger? Is it always bigger? Investigate as follows: (i) Write a simple program which defines a huge array, e.g.: double a[700][700]; (ii) Have your program access the array: - sequentially (version 1) - randomly (version 2) for about 2 minutes (state A); then, call the sleep() command to idle your program for 2 minutes (state B); and, finally have your program access the array again (state C). Use 'ps -el' or 'top' and check the SZ and RSS field values as your program runs and enters the different states. Explain your observations. Better yet explain the different behaviour between version 1 and version 2 of your program. 2. Have a read of the following memory management system calls: mpin mprotect plock Do you understand what they do? Are you brave enough to try some of these out yourself? 3. Finally sit back and relax with 'gr_osview -a'. Read the 'gr_osview' manual and find out what the Memory is measuring, that is, what do the following mean: kernel fsctl fsdirty fsclean free user Refer to the INTERPRETING THE DISPLAY section of the manual and read the sections discussing: rmem rmemc fault tlb pswap swp Fascinating isn't it? Now display all those Memory management activity bars as follows: $ echo "rmem\nrmemc\nfault\ntlb\npswap\nswp" | gr_osview -D - Can you relate to all the displayed activity? What is the operating system doing? Is it thrashing? Now repeat 1. again and see what happens! 4. Now try 'osview' and keep an eye on the System Memory, Memory Faults values. Read the 'osview' manual to learn how to activate hidden displays (those marked with an *). Activate the Swap, System VM and TLB Actions displays.