|
Home > Archive > Unix Programming > April 2005 > Util to measure page faults ?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Util to measure page faults ?
|
|
|
|
I have a bug in a PERL script that I believe may be related to
thrashing (excessive number of page faults). The script up to a
critical input size the script finishes in under 5s, but when the
size of the input exceeds the critical value by the smallest possible
increment, the script runs for about 15 minutes and then perl
seg-faults.
I have created a small snippet that replicates the script's behavior
(or at least my diagnosis of what is happening), except that the
seg-faulting happens in less than 1s, which makes me wonder whether
the snippet really captures the problem with the original script.
Still, it is possible to have a very high number of page faults in
one second, so I am looking for a simple utility that will give me
page fault stats for both the snippet and the original script. I
know that ps does this, but the script runs too quickly to be used
comfortably with ps.
One requirement is that the utility should not require the code to
be recompiled with some special flags, since I would like to avoid
having to rebuild PERL just to get a page fault count.
Any suggestions would be much appreciated. My OS is Linux (Debian).
Thanks!
kj
P.S. Is there a better forum to post this question to, please let
me know.
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
| |
| Jens.Toerring@physik.fu-berlin.de 2005-04-27, 5:58 pm |
| kj <socyl@987jk.com.invalid> wrote:
> I have a bug in a PERL script that I believe may be related to
> thrashing (excessive number of page faults). The script up to a
> critical input size the script finishes in under 5s, but when the
> size of the input exceeds the critical value by the smallest possible
> increment, the script runs for about 15 minutes and then perl
> seg-faults.
Trashing shouldn't result in a segmentation fault, just slow down
your machine considerably. You may have found a bug in the Perl
interpreter.
> I have created a small snippet that replicates the script's behavior
> (or at least my diagnosis of what is happening), except that the
> seg-faulting happens in less than 1s, which makes me wonder whether
> the snippet really captures the problem with the original script.
Perhaps you should post that script here so other people can have a
look...
> Still, it is possible to have a very high number of page faults in
> one second, so I am looking for a simple utility that will give me
> page fault stats for both the snippet and the original script. I
> know that ps does this, but the script runs too quickly to be used
> comfortably with ps.
You always can write a shell script that starts the PERL script and
than repeatedly calls ps, perhaps redirecting the output to a file,
so you can analyze the output. That should be much faster than you
can type;-)
> One requirement is that the utility should not require the code to
> be recompiled with some special flags, since I would like to avoid
> having to rebuild PERL just to get a page fault count.
> P.S. Is there a better forum to post this question to, please let
> me know.
If it's a PERL problem there are a lot of PERL related newsgroups.
Posting a PERL script there that crashes with a sementation fault
probably will get the attention of a lot of people who might be
interested to help you.
Regards, Jens
--
\ Jens Thoms Toerring ___ Jens.Toerring@physik.fu-berlin.de
\__________________________ http://www.toerring.de
| |
| Måns Rullgård 2005-04-28, 7:55 am |
| Jens.Toerring@physik.fu-berlin.de writes:
> kj <socyl@987jk.com.invalid> wrote:
>
> Trashing shouldn't result in a segmentation fault, just slow down
> your machine considerably. You may have found a bug in the Perl
> interpreter.
It sounds like he's done something that uses an exponential (or
otherwise large) amount of memory.
>
> You always can write a shell script that starts the PERL script and
> than repeatedly calls ps, perhaps redirecting the output to a file,
> so you can analyze the output. That should be much faster than you
> can type;-)
vmstat might be useful, too.
--
Måns Rullgård
mru@inprovide.com
|
|
|
|
|