Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Memory page

414 bytes added, 00:34, 13 December 2006
added C code to print pagesize on unix systems
Size of memory page is architecture and operating system dependant. On an x86 and x86_64 hardware, memory page is equal to 4KB. On an Intel Itanium (IA64) memory page size is 16KB.
 
You can get the actual value on your Linux/UNIX system with the '''getpagesize'''-Syscall. Here is a C Program that prints the pagesize on your system :
 
<code>
#include <unistd.h>
#include <stdio.h>
 
int main(int argc, char* argv[])
{
long sz = sysconf(_SC_PAGESIZE);
printf("memory pagesize on this box : %i\n", sz);
return 0;
}
</code>
 
compile with : gcc -o getpagesize getpagesize.c
 
[[Category:Definitions]]
2
edits