Redian新闻
>
how to track page faults when allocation
avatar
how to track page faults when allocation# Unix - 噫吁兮,危乎高哉
g*t
1
Hi,
I am trying to track the memory usage, especially the page faults during
allocation. I found there is a getrusage() method, which tracks page faults
and page reclaims. My questions are as follows:
1. what does "page reclaims" mean? how to interpret it? Does that mean (a) if
a page Pi was used for Ni times without page faults, then ru_minflt = \sum {
Pi * Ni} ?
reference:
http://www.fifi.org/cgi-bin/man2html/usr/share/man/man2/getrusage.2.gz
struct rusage { ...
long ru_minfl
avatar
w*n
2
4G just means your system is a 32-bit addressing system (2^32 is maximum
integer you could get for memory size), the real limit is the
actual amount of memory (maybe + swap ) in your system
I don't know your motivation of tracking page fault, in most cases page
fault is handled in kernel concept without any signal triggered unless
the memory is ill addressed (SIGSEGV).if you want to handle SIGSEGV, just
write your own signal handler for the process.

【在 g****t 的大作中提到】
: Hi,
: I am trying to track the memory usage, especially the page faults during
: allocation. I found there is a getrusage() method, which tracks page faults
: and page reclaims. My questions are as follows:
: 1. what does "page reclaims" mean? how to interpret it? Does that mean (a) if
: a page Pi was used for Ni times without page faults, then ru_minflt = \sum {
: Pi * Ni} ?
: reference:
: http://www.fifi.org/cgi-bin/man2html/usr/share/man/man2/getrusage.2.gz
: struct rusage { ...

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。