cancel
Showing results for 
Search instead for 
Did you mean: 

page size

Chakravarthi
Trusted Contributor

page size

How do i check the page size in linux

thanks
chakri
4 REPLIES
Mark Grant
Honored Contributor

Re: page size

THe best I can find is to look in /usr/src/linux/include/asm/page.h though it sort of depends on your architecture.

Never preceed any demonstration with anything more predictive than "watch this"
Martin P.J. Zinser
Honored Contributor

Re: page size

Hello Chakri,

how about the following:

#include
#include
#include
int main(){
printf("%d\n",getpagesize());
return EXIT_SUCCESS;
}


Assuming you put this into temp.c

cc temp.c
./a.out
4096

(This is from a x86 system).

Greetings, Martin
rvrameshbabu
Advisor

Re: page size

The command getconf also can be used to find pagesize

# /usr/bin/getconf PAGESIZE
4096
Guru Dutta
Frequent Advisor

Re: page size

u can also use sysconf(_SC_PAGESIZE).This return a long.