Re: Freebsd 14.3 wired memory custom or generic kernel

From: Kun <kunn_at_yaani.com>
Date: Mon, 08 Sep 2025 18:57:42 UTC
so,


du(1) is "the on-disk size" (the amount of physical storage space the 
.ko file consumes on the disk) (compressed, unlinked ELF file), (a 
storage container)

kldstat(8) is "the in-memory size" (the amount of virtual memory the 
kernel module occupies after it has been loaded into the kernel's adress 
space) (decompressed, linked, running code) , (a running program in 
kernel space)

-.ko file that du(1) reports is compressed,
-kldstat(8) reports decompressed code (if it was compressed).
-kldstat(8) linker performs neccesary relocations (adjusting memory 
addresses so the code runs correctly at its loaded location, allocates 
memory for the module's code and data segments within the kernel's 
memory space).
-in short kldstat(8) shows the size of the decompressed, relocated, and 
loaded module in RAM. it reports the runtime memory footprint ?  (in 
short it is a process of kernel's packing (du(1)'s reporting) and 
loading (kldstat(8)'s reporting) process ?)

it this thinking of mine is correct regarding this matter ? (this is 
what i understood of your reply (kernel file has its own storage format, 
source data for kernel image in memory that has another format)


thank you



On 9/8/25 8:24 AM, Eugene Grosbein wrote:
> 08.09.2025 6:42, Kun пишет:
>> i see, majority of all that 120mb wired memory is triangle of virtual memory, buffer and cache as it seems to be.
>>
>> what bothered me was even with generic kernel wired memory was 120mb, and even with a 15MB sized kernel , wired memory was 120mb.
>>
>> thank you for your guidance and help :)
>>
>> ========================================================================
>>
>> if its possible, could you also comment on "Regarding the fact that kldstat(8) and du(1) on kernel file report different sizes"
> 
> Why should it report same size? Kernel file has its own storage format, just some source data
> for kernel image in memory that has another format.
>