I'm running Debian Linux. uname -m says i686 which means 32-bit architecture machine with pae flag enabled. getconf LONG_BIT  is 32. Installed RAM capacity is 6GB.My /proc/cpuinfo has an entry address sizes  : 40 bits physical, 48 bits virtual. However, my program is generating only 32 bit address. (Address of x is 0xbfbaf5cc)I do not understand the relation between 48 bit virtual address shown by cat /proc/cpuinfo and the virtual address generated by the C program. Complete CPU info can be found here.Could somebody explain?
Physical Address Extension - how do virtual addresses work?
linux;memory;virtual memory;pae
PAE doesn't change anything about virtual addresses. As the name hints, it's only about physical addresses. As an application programmer, PAE doesn't change anything for you. Your program still has a 32-bit address space, out of which the kernel takes approximately 1 bit (Linux grants 1GB, 2GB or 3GB to userspace depending on compilation options). If you want a larger address space, you need a 64-bit system.The point of PAE is to allow the kernel to address more than 4GB of physical RAM. In order to make use of all this RAM, you need multiple processes, each of which can map at most 2GB (or 1GB or 3GB).In PAE mode, MMU tables map 32-bit virtual addresses to 40-bit physical addresses, with a three-level table (unlike non-PAE mode where the MMU tables map 32-bit virtual addresses to 32-bit physical addresses with a two-level table).The indication 48 bits virtual refers to the CPU's capabilities. I think this means that the CPU is a 64-bit one (i.e. one that supports amd64 a.k.a. x86-64). In order to make use of 48-bit virtual addresses, you'd need to run a 64-bit operating system. Here 48-bit is a little confusing for an application programmer: the CPU translates only 48 bits of the address, but the address is encoded in 64 bits pointers occupy 8 bytes, not 6. The upper 16 bits can contain additional tags used by the operating system.