[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: SRM vs ARC



On Sunday, 31 Jan, Oscar Levi wrote:
> > 
> > [cassiel:linux]$ size vmlinux
> >    text    data     bss     dec     hex filename
> > 1222869  216904  198988 1638761  190169 vmlinux
> > 
> > The in-memory size of your kernel will be about 1.5MB.
> > 
> 
> Oh, duh.  Are the allocated buffers visible from 'free'?  In other
> words, is the kernel image the only memory consumption hidden from
> free?  Do we lose something, .5MB, where the BIOS ROMS are located?
> 

The breakdown is as follows.

Total memory as reported by `free' is counted as the full memory size
minus reserved pages.  The number of reserved pages is shown on the
console when you press Shift-ScrollLock.  Reserved pages come from the
following sources:

 - Console (SRM or MILO): most of these contain the in-memory console
   image, which is preserved all the time Linux is running (MILO is kept
   compressed).  The rest comprises PALcode and HWRPB (9 pages).
   Current MILOs always report as taking up half a megabyte (an
   overestimate), bringing total to 73; newer MILOs will report their
   actual size.

 - Kernel image: the size is as reported by `size' plus some very small
   amount spent on alignments.

 - "Static" kernel structures, allocated during startup, such as the
   memory map.  On my machine with 64 Mb RAM running 2.1.131 these
   consume 98 pages.

On 2.1 and 2.2 kernels, some memory belonging to the kernel image is
freed after the initialisation (usually 8 pages).

For example, this is how it looks on my machine:
 MILO:               73
 vmlinux:           206
 kernel allocated:   98
 freed:              -8
------------------------
 Total reserved:    369 pages (2952 kB)

$ free
             total       used       free     shared    buffers     cached
Mem:         62584      60768       1816      30792       3304      25272
-/+ buffers/cache:      32192      30392
Swap:       131064      14216     116848

Nikita


Reply to: