/proc is huge!

For interesting topics. But remember this is a Linux Forum. Do not post offensive topics that are meant to cause trouble with other members or are derogatory towards people of different genders, race, color, minors (this includes nudity and sex), politics or religion. Let's try to keep peace among the community and for visitors.

No spam on this or any other forums please! If you post advertisements on these forums, your account may be deleted.

Do not copy and paste entire or even up to half of someone else's words or articles into posts. Post only a few sentences or a paragraph and make sure to include a link back to original words or article. Otherwise it's copyright infringement.

You can talk about other distros here, but no MX bashing. You can email the developers of MX if you just want to say you dislike or hate MX.
Message
Author
User avatar
Richard
Posts: 1577
Joined: Fri Dec 12, 2008 10:31 am

/proc is huge!

#1 Post by Richard »

Thunar indicates that /proc contains 140.7 TB, while DoubleCommander shows 131071.99 GiB.
Image
If you have ever noticed this and wondered what the explanation might be, the following provides a possible answer.

I thought this was unusual and figured there must be a good reason/answer for it.
Today I decided to search for it, which produced references to a possible answer in the LinuxMint forum:
Re: Why is the size of /proc 140 TB? (SOLVED)
Post by Cosmo. » Sun Aug 23, 2015 5:25 am

The "biggest file" (in quotation marks, because those files are not really there) is kcore, which "takes" nearly the whole amount of /proc.

Looking for an answer how this is explainable I found at first this in unixguide, but that doesn't seem to be right, because
/proc/kcore is like an "alias" for the memory in your computer. Its
size is the same as the amount of RAM you have, and if you read it as
a file, the kernel does memory reads.
would mean I would have 140 TiB RAM (does any super-computer have this amount?)

The answer here at askubuntu seems to be the correct answer:
This file ... is as big as the address space that Linux could potentually address at max.
Well, maybe, sort of; however, supposedly the 64 bit memory limit is 128 Terrabytes.
Perhaps it's just a problem of scale with Thunar, DoubleCmd and other file managers?

Code: Select all

richard@mx171:/proc
$ df -h /proc
Filesystem      Size  Used Avail Use% Mounted on
proc               0     0     0    - /proc
Does anyone have another, better explanation?
Thinkpad T430 & Dell Latitude E7450, both with MX-21.3.1
kernal 5.10.0-26-amd64 x86_64; Xfce-4.18.0; 8 GB RAM
Intel Core i5-3380M, Graphics, Audio, Video; & SSDs.

User avatar
Gordon Cooper
Posts: 965
Joined: Mon Nov 21, 2011 5:50 pm

Re: /proc is huge!

#2 Post by Gordon Cooper »

I have met up with bytes "rounding up to" elsewhere, happens a bit in GParted, but never struck anything even approaching 140 TB!
Backup: Dell9010, MX-19_B2, Win7, 120 SSD, WD 232GIB HD, 4GB RAM
Primary :Homebrew64 bit Intel duo core 2 GB RAM, 120 GB Kingston SSD, Seagate1TB.
MX-18.2 64bit. Also MX17, Kubuntu14.04 & Puppy 6.3.

antiX-Dave
Developer
Posts: 372
Joined: Mon Apr 16, 2012 4:51 pm

Re: /proc is huge!

#3 Post by antiX-Dave »

I try with spacefm / du and they both report 0 as the amount of disk space used... though kcore shows a "size" of 128 tb for the file but the size on disk is still 0.

I have never really thought about it... My *guess* based on that and what you posted would be that the size counting method is seeing the limit of what you *could* virtually have for ram. As in what soft limit the kernel has set given the way the kernel handles memory and the type of hardware you have. Even though you could not physically add that much memory to your machine. And I would further guess that even though you may have a 64 bit machine a smaller amount of bits are actually used (say 47 bits) which might vary from machine to machine (47 on one 41 on another) allotting for the variations in outputed size readings.

User avatar
Richard
Posts: 1577
Joined: Fri Dec 12, 2008 10:31 am

Re: /proc is huge!

#4 Post by Richard »

It was a surprise to me also.
I was sure I'd broken something. :)

I believe it's just a quirk of file managers.
Probably they are all using the same type of algorithm.
Except 'df' which shows the correct size.
NOTE: and SpaceFM, du...
Thinkpad T430 & Dell Latitude E7450, both with MX-21.3.1
kernal 5.10.0-26-amd64 x86_64; Xfce-4.18.0; 8 GB RAM
Intel Core i5-3380M, Graphics, Audio, Video; & SSDs.

User avatar
Adrian
Developer
Posts: 8266
Joined: Wed Jul 12, 2006 1:42 am

Re: /proc is huge!

#5 Post by Adrian »

Yes, that's the explanation, it's a virtual memory addressable space.
I think it's 128TiB (Tebibytes) which is 140 TB (Terabytes).

BTW, 131071.99 GiB = 128 TiB (rounded of course)

User avatar
stsoh
Posts: 183
Joined: Sun Aug 20, 2017 10:11 am

Re: /proc is huge!

#6 Post by stsoh »

what is kcore(140tb)?
google kcore, u will find explanation as:
/proc/kcore specifically is a file which maps directly to every available byte in your virtual memory.
MX-17.1_x64 Horizon, G41M-P33 Combo (MS-7592), Pentium E5400 (2706 MHz), 8Gb RAM (984 MT/s),
Intel 4 Series Integrated Graphics, Realtek PCIe Fast RTL8101/2/6E, PCI Gigabit RTL8169 Ethernets.
Accepted Linux when i found MX-Linux in 2016.

User avatar
Eadwine Rose
Administrator
Posts: 11949
Joined: Wed Jul 12, 2006 2:10 am

Re: /proc is huge!

#7 Post by Eadwine Rose »

I don't even have a /proc/kcore on my system, but the proc thing is indeed loads of TB
MX-23.2_x64 July 31 2023 * 6.1.0-20-amd64 ext4 Xfce 4.18.1 * 8core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 525.147.05 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 860EVO * Samsung S24D330 & P2250 * HP Envy 5030

User avatar
stsoh
Posts: 183
Joined: Sun Aug 20, 2017 10:11 am

Re: /proc is huge!

#8 Post by stsoh »

no kcore then find out where is 140tb from?
MX-17.1_x64 Horizon, G41M-P33 Combo (MS-7592), Pentium E5400 (2706 MHz), 8Gb RAM (984 MT/s),
Intel 4 Series Integrated Graphics, Realtek PCIe Fast RTL8101/2/6E, PCI Gigabit RTL8169 Ethernets.
Accepted Linux when i found MX-Linux in 2016.

User avatar
Eadwine Rose
Administrator
Posts: 11949
Joined: Wed Jul 12, 2006 2:10 am

Re: /proc is huge!

#9 Post by Eadwine Rose »

I don't know.
MX-23.2_x64 July 31 2023 * 6.1.0-20-amd64 ext4 Xfce 4.18.1 * 8core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 525.147.05 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 860EVO * Samsung S24D330 & P2250 * HP Envy 5030

User avatar
Adrian
Developer
Posts: 8266
Joined: Wed Jul 12, 2006 1:42 am

Re: /proc is huge!

#10 Post by Adrian »

https://unix.stackexchange.com/question ... e-by-linux
Also if you take a look at the kernel docs, Documentation/x86/x86_64/mm.txt:

Virtual memory map with 4 level page tables:

0000000000000000 - 00007fffffffffff (=47 bits) user space, different per mm
So 2^47 bytes = 128TiB


And 128TiB = 140TB, so there's that.

Post Reply

Return to “General”