Zhihui Zhang wrote: > Basically I have a program that does a lot of I/O and alloctes/frees a lot > of memory. The time command gives result like this: > > 6.239u 19.329s 7:59.76 5.3% 310+775k 3993+246io 7pf+0w > > I want to know why CPU is running only 5.3% of the total time. I just > want know how long it is waiting for memory and how long it is waiting for > I/O. No other process is running at the same time.
You got 7 page faults with 0 waits. So it was waiting for I/O 94.7% of the time. That's statistical; the real calculation is 100% - 246/3993 = 93.8%. Generally, this comes down to a design issue that's very common in code these days, particularly code where people think "threads solve all concurrency problems". I think I should patent the correct way of solving this problem, since no one seems to use it. I'll call it "interleaved I/O"... -- Terry To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message