I am working on an embedded Linux system (5.10.24), and now I want to check what is the minimal kernel I can build, so with lots of playing of kernel configurations, now I have following kernel.
# dmesg | grep 'Memory:' Memory: 12620K/16384K available (1933K kernel code, 128K rwdata, 236K rodata, 192K init, 55K bss, 3764K reserved, 0K cma-reserved) # free total used free shared buff/cache available Mem: 12812 2624 8808 0 1380 8928 Swap: 0 0 0 I have disabled some critical kernel codes like sysfs and drivers.
So currently, I cannot optimization in kernel configuration to decrease the kernel memory usage.
This is normal kernel and running on MPU with MMU, for now I may not turn to uCLinux.
Next, I may change the code manually, by disabling or simplifying the kernel codes. But before I do that, I firstly want to narrow down the kernel features which are using more memory than others.
So is there any advice which codes should I focus on firstly? And is there any tool to help me figure out which part of kernel takes more memory which I should pay attention to?