How to reduce cached memory used by Linux kernel on embedded linux platform

34 views Asked by At

I have booted Linux within 32 MB of SRAM and looking to optimize the cached memory used by Linux kernel. after login to command prompt, I see almost 8 MB memory was consumed by cached memory by Linux kernel. From my explore I saw cached memory is used when we have disk io operations but in my case initramfs unpacked inside SRAM itself. so as per my understanding I can reduce this memory w/o any impact on performance correct me in case I missed something to understand.

memory_usage

Query 1: Is there way to control this limit using some kernel config itself or way before we reach to user space?

I came across the userspace ways to control it but I didnt see its working for me, Do i need to enable any specific kernel config option which will make below command effective I tried below commands.

   sync && echo 1 > /proc/sys/vm/drop_caches
    sync && echo 2 > /proc/sys/vm/drop_caches
    sync && echo 3 > /proc/sys/vm/drop_caches 

see the console outputs of below commands. cache_use_command output Query 2: I have also disabled CONFIG_SHMEM from kernel, which helped me to reduce shared memory section in free command as 0(earlier it consumed nearly 6 MB). Is there any impact of disabling CONFIG_SHMEM on drivers of my system?

0

There are 0 answers