This is the pre-processor variable DO_PRINTK.

Sometimes, the size reductions are accomplished by reducing the number of objects for a particular features (like the number of possible swap areas, or the number of tty discipline structures). Wasting 1MB of permanently-used kernel memory on a 32MB embedded system is a big deal. This incremental growth in kernel size has been a big concern by forum members. For example, This is a features of Linux-tiny, which tracks callers of kmalloc and kfree, and produces
According to gcc's manual, this option no longer does anything. In order to change the set of printk messages preserved in the code, you will need to modify the lines, and recompile the kernel. configuration options. Linux increased in size by between 10% and 30% from version 2.4 to 2.6. The size of this image can be obtained by examining the size of the image file in the host filesystem with the 'To use the size command, run it with the filename of the uncompressed kernel image (which is usually In order to find areas where the kernel size can be reduced, it is often useful to break down CSiBE is a code size benchmark for the GCC compiler. Turning off sysfs support can save a substantial amount of memory in some setups.

If your set of applications is small, sometimes it makes more sense to statically link Another special preprocessor variable is also available, called DO_PRINTK, which provides the ability to enable printk messages inside a single C compilation unit, even if printk messages are disabled globally. 4 ways to check the size of physical memory (RAM) in Linux Published: September 19, 2017 | Modified: June 20, 2020 | 84,452 views An article explaining how to check physical memory (RAM) in the Linux server. Tim's work was presented at LinuxCon Japan in May, 2013. This is a short document describing the preferred coding style for the linux kernel.

I just wrote In 100 ms, mysqld touched 28 Mbytes worth of pages, out of its 404 Mbytes of total main memory. available in Linux. your applications than to use shared libraries. I'm trying to do minimal kernel size with xconfig.

Please see the individual products' articles for further information. However, dealing with files inside the kernel is frowned upon, and you may want to consider if there isn't a BETTER alternative - for example, if you want to load some file-stuff into the memory of a board that is on your system, you could load the file in a user-mode process, and then pass the loaded parts into the kernel via some private IOCTL type function.

Btw, i'm using virtual box.
You can save RAM memory by using some text or data directly from flash. The Overflow Blog

But many features are not needed in Consumer Electronics products. in network stack that requires about 170K to run (versus 400K for the default stack).

usually misses). Here is It's a bit more involved to use. In addition, compilation time and code performance measurements are also provided. (I.e. These patches are described at: Linux Tiny. If the "do-printk" patch is applied, there are two options which control the compilation of printk elements in the kernel: CONFIG_PRINTK_FUNC and CONFIG_PRINTK. @Junaga: you realize linux is very portable and scalable, right? This section lists various efforts to produce the absolute smallest system possible. That means that it only contains what you actually need, not everything you might ever need. The following tables compare general and technical information for a number of widely used and currently available operating system kernels. You might want to collect this several times to determine what a normal WSS profile looks like.Graphing the above profile as a scatter plot, along with results from a microbenchmark with a uniform access distribution of 100 Mbytes:The microbenchmark shows a steady WSS of 100 Mbytes, with the exception of the first point: that was so quickly that the program didn't have enough time to touch its whole WSS. this theory on Linux, but this has been discussed on the kernel mailing list. because it could reduce cache misses.

Tim also found some very interesting academic research on link-time re-writing and cold-code compression. The kernel’s command-line parameters¶. 6 2013-04-12 PA1 Bloat trajectory • Software gets more generalized over time • Kernel growing by 10% per year for last 10 years • Can't use strategy of manual tuning (i.e. Another option, -mregparm=3, seems to be x86 specific, it instructs the (Table taken from page 25 of Linux kernel coding style¶. By setting this option to 'N' in your kernel configuration, all uses of "printk" throughout the kernel source are turned into empty statements, and omitted when the program is compiled. From this information you may be able to predict what the affect of the change will be, and decide whether the change is acceptable. How to find out a linux kernel ring buffer size? A non-stripped kernel with default configuration resulted in a size of 1897996 kB (including kernel + modules).

This is useful because as you make changes to the kernel configuration you can determine what part of the kernel is affected by the change. making a RAM page for it. I am reading into vfsmount and dentry but am still lost.The call to this function changes depending on which kernel version you are using. Note that Cramfs and Squashfs, due to their "write-only-once" nature, can also be used on MTD storage. Here's a link to the LKML discussions around it: It has long been theorized that reducing system size could provide a performance benefit are interesting for tuning the kernel size is provided in the section: "Kernel configuration Options" You can strip both executables as well as shared libraries.

Glibc is about 2 meg. Most systems I look after have one process consuming most of main memory: so I'd like to skip the process pagemap step and just study the idle map.I did try a dangerous solution to the measurement span inflation: sending the process SIGSTOP and SIGCONT signals, so that it only ran during the intended WSS duration, and outside of that it was paused. distributions. Sometimes, the size reductions are achieved by removing features or functions from the kernel.