Linux Find Out Virtual Memory PAGESIZE

by Vivek Gite on January 2, 2008 · 8 comments

Q. How do I check the size of PAGESIZE under Linux?

A. Most modern operating systems have their main memory divided into pages. It allows better utilization of memory. A page is a fixed length block of main memory, that is contiguous in both physical memory addressing and virtual memory addressing. Kernel swap and allocates memory using pages

To display size of a page in bytes, enter:
$ getconf PAGESIZE
OR
$ getconf PAGE_SIZE
Output:

4096

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 8 comments… read them below or add one }

1 oksander m-a January 13, 2009

Can’t tell you how long I spent searching for this information. I knew it was simple and obvious, but I couldn’t remember it, so I could look it up! So many sites skip the command to get your page size. Points to you for having the info up and easy to parse.

Reply

2 Mit April 27, 2009

Thanks. Nice info!

Reply

3 Segun June 2, 2009

Thanks for the sharp tip.

Reply

4 Hei July 16, 2009

Is there a way to change the page size?

Reply

5 wx672 October 20, 2011

Guess you have to change the kernel source.

In /usr/src/linux/include/asm-generic/page.h you can find the following lines:

/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 12

Reply

6 lieven December 5, 2011

is this MB or KB or GB??

Reply

7 person December 23, 2011

bytes

Reply

8 johnf February 1, 2012

I think it’s the base-2 logarithm of the page size. In other words, 2^PAGE_SHIFT is the page size. 2^12=4096, the usual page size in bytes

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 5 + 11 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the simple math so we know that you are a human and not a script.




Previous post:

Next post: