What's the max file mapping size in 64bits machine

后端 未结 5 1296
情话喂你
情话喂你 2021-01-12 15:55

I\'m new to 64-bits architecture. Could you tell me what\'s MAX file size supported by file mapping in 64 bits linux machine. I want to open more than 20GB files by file map

5条回答
  •  悲哀的现实
    2021-01-12 16:21

    Although pointers are 64-bit wide, most processors do not actually support virtual addresses using the full 64 bits. To see what size virtual addresses your processor supports, look in /proc/cpuinfo (48 bits is typical).

    grep "address sizes" /proc/cpuinfo
    

    Additionally, half of the virtual address space is used by the kernel and not available to userspace - leaving 47 bits in the current Linux implementation.

    However, even taking this into account, you will still have plenty of room for a 20GB file. 47 bits in theory means a virtual address space of 128TB.

提交回复
热议问题