When there are performance problems in a small portion of the program, collect data for just that part of the program. Because programs exhibit different behavior during different phases of operation, you need to identify the limiting resource for each phase. Once you have identified the limiting resource in a phase, you can perform an in-depth analysis to find the problem. A CPU-bound process spends its time in the CPU and is limited by CPU speed and availability. A memory-bound program continuously swaps out pages of memory.
Page thrashing is often due to accessing virtual memory on a haphazard rather than strategic basis.
To fix a memory-bound process, try to improve the memory reference patterns by increasing local references, or, if possible, decrease the memory used by the program. Bugs Certain bugs can cause performance problems. Floating point exceptions are slowing down the program. Old code has not been completely removed. The SpeedShop performance tools described in this manual can help you to identify specific performance problems described later in this chapter.