Application execution over a range of memory sizes with the rmss command
As a driver program, the rmss command executes a specified application over a range of memory sizes and displays statistics describing the application's performance at each memory size.
rmss [ -s smemsize ] [ -f fmemsize ] [ -d memdelta ]
[ -n numiterations ] [ -o outputfile ] commandEach of the following flags is discussed in detail below. The -s, -f, and -d flags are used to specify the range of memory sizes.
- -n
- This flag is used to specify the number of times to run and measure the command at each memory size.
- -o
- This flag is used to specify the file into which to write the rmss report, while command is the application that you wish to run and measure at each memory size.
- -s
- This flag specifies the starting size.
- -f
- This flag specifies the final size.
- -d
- This flag specifies the difference between sizes.
-s 256 -f 128 -d 32-s 128 -f 256 -d 32If the -s flag is omitted, the rmss command starts at the actual memory size of the machine. If the -f flag is omitted, the rmss command finishes at 8 MB. If the -d flag is omitted, there is a default of 8 MB between memory sizes.
What values should you choose for the -s, -f, and -d flags? A simple choice would be to cover the memory sizes of systems that are being considered to run the application you are measuring. However, increments of less than 8 MB can be useful, because you can get an estimate of how much space you will have when you settle on a given size. For instance, if a given application thrashes at 120 MB but runs without page-ins at 128 MB, it would be useful to know where within the 120 to 128 MB range the application starts thrashing. If it starts at 127 MB, you may want to consider configuring the system with more than 128 MB of memory, or you may want to try to modify the application so that there is more space. On the other hand, if the thrashing starts at 121 MB, you know that you have enough space with a 128 MB machine.
-n 3What are good values to use for the -n flag? If you know that your application takes much more than 10 seconds to run, you can specify -n 1 so that the command is run twice, but measured only once at each memory size. The advantage of using the -n flag is that the rmss command will finish sooner because it will not have to spend time during initialization to determine how many times to run your program. This can be particularly valuable when the command being measured is long-running and interactive.
It is important to note that the rmss command always runs the command once at each memory size as a warm-up before running and measuring the command. The warm-up is needed to avoid the I/O that occurs when the application is not already in memory. Although such I/O does affect performance, it is not necessarily due to a lack of real memory. The warm-up run is not included in the number of iterations specified by the -n flag.
The -o flag is used to specify a file into which to write the rmss report. If the -o flag is omitted, the report is written into the file rmss.out.
Finally, command is used to specify the application to be measured. It can be an executable program or shell script, with or without command-line arguments. There are some limitations on the form of the command however. First, it cannot contain the redirection of input or output (for example, foo > output or foo < input). This is because the rmss command treats everything to the right of the command name as an argument to the command. To redirect, place the command in a shell script file.
# (rmss -s 24 -f 8 foo) >> output