Por que o tamanho do arquivo “/ proc / kcore” é tão grande quanto o tamanho da memória física?

3

De proc manual:

/proc/kcore

This file represents the physical memory of the system and is stored in the ELF core file format. With this pseudo-file, and an unstripped kernel (/usr/src/linux/vmlinux) binary, GDB can be used to examine the current state of any kernel data structures.

The total length of the file is the size of physical memory (RAM) plus 4KB.

Eu posso ver que o tamanho de /proc/kcore é o tamanho da memória física (RAM) mais 4KB.

Mas no meu SuSE Linux :

# ls -lt  --block-size=M /proc/kcore
-r-------- 1 root root 134217727M Nov 15 21:09 /proc/kcore

    # cat /proc/meminfo
MemTotal:         792680 kB
MemFree:           79960 kB
MemAvailable:     351664 kB
Buffers:              40 kB
Cached:           246588 kB
SwapCached:          212 kB
Active:           282992 kB
Inactive:         292896 kB
Active(anon):     122652 kB
Inactive(anon):   214164 kB
Active(file):     160340 kB
Inactive(file):    78732 kB
Unevictable:         100 kB
Mlocked:             100 kB
SwapTotal:       1532924 kB
SwapFree:        1531088 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:        329148 kB
Mapped:            71888 kB
Shmem:              7556 kB
Slab:              63088 kB
SReclaimable:      46300 kB
SUnreclaim:        16788 kB
KernelStack:        1888 kB
PageTables:            0 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     1929264 kB
Committed_AS:    1451492 kB
VmallocTotal:   34359738367 kB
VmallocUsed:        7580 kB
VmallocChunk:   34359726080 kB
HardwareCorrupted:     0 kB
DirectMap4k:      867568 kB
DirectMap2M:           0 kB

Por que o tamanho do arquivo /proc/kcore é tão grande quanto o tamanho da memória física?

    
por Nan Xiao 16.11.2015 / 03:35

1 resposta

2

kcore é a alocação virtual da sua RAM para o kernel. Em sistemas de 64 bits, esse tamanho pode ser um limite absoluto de 128T, já que é o máximo que o sistema pode alocar.

    
por 29.01.2016 / 22:47