UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer wmaxfield
Observer
8,886 Views
Registered: ‎05-21-2008

how to reduce ppc linux memory footprint

I've been recompiling the kernel, and have it down to about 2 megs in physical size. I downloaded buildroot, and have the initrd ramdisk down to 1.1 meg, and will be reducing it further.

 

However, when I boot the kernel, it used 8 megs of ram, down from 8.5 megs of ram.  There are no real processes running, I've removed the getty's for tty1, tty2.

 

 I would like for it  to run in between 4 to 6 megs of ram total.

 

 Can someone give me some clues as to why it is using so much memory, and how I can reduce that memory footprint?

Tags (2)
0 Kudos
4 Replies
Adventurer
Adventurer
8,856 Views
Registered: ‎10-28-2007

Re: how to reduce ppc linux memory footprint

Are you using initramfs or a 'normal' ramdisk? How are you measuring the memory consumption?
0 Kudos
Observer wmaxfield
Observer
8,852 Views
Registered: ‎05-21-2008

Re: how to reduce ppc linux memory footprint

 

  I'm using an initramfs, and it is 1.1 meg, which I can reduce somewhat.

 

  I'm using free to measure the memory usage.

 

  if I boot into 8 meg of ram, there is not enough "free" ram to let me log into the system, I have to boot into more than 8 meg of ram, so I know the usage is that much, and it agrees with the "free" command's response.

 

  After several days of googling, I found that 32 meg is considered a normal size for linux now.  Also, I found that if I choose the "SLOB" memory management, the kernel will refuse to finish init during the boot phase, so that is out. 

 

  It appears that slightly over 7 meg (assuming 0 initramfs) is about what I can expect to need as a base boot, with no programs running at all.  

 

  We are having to investigate adding memory to the system.

0 Kudos
Xilinx Employee
Xilinx Employee
8,848 Views
Registered: ‎04-23-2008

Re: how to reduce ppc linux memory footprint

>I'm using an initramfs, and it is 1.1 meg, which I can reduce somewhat.

Is that 1.1MB compressed, or after decompression?

 

There's probably still some kruft in the kernel config to remove (unused filesystems, drivers, etc...). I'd look through every single config menu. If you have networking support, make sure IPV6 isn't selected, etc...

 

Are you optimizing for size "-0s" ? The default is "-O2".

You could build a slimmed-down busybox as well. Using shared libraries may help, if you are not already. 

 

With such limited RAM, could you consider placing the filesystem in flash and not use a ramdisk at all?

 

-Brian 

0 Kudos
Observer wmaxfield
Observer
8,845 Views
Registered: ‎05-21-2008

Re: how to reduce ppc linux memory footprint

 1.1 meg is after uncomression.

 

  yes, it is reduced.  the original kernel size was 4 megabytes, it is now down to 2 megabytes.  If I pull out any more, I get unbootable stuff.

 

  I can reduce about 1 meg using the techniques you suggest, but only that.  I need about 3 meg reduction, and it does not look like I will get there.

0 Kudos