Size Optimization for an embedded system

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
I have a few questions aregarding size optimization :
1.  I have already applied the linux kernel Tiny patch but I need to
further reduce the size of the kernel.Any suggestions?
2.  Is there a tool with low memory footprint to find out the dynamic
memory usage of applications during runtime?Applications like
iptables,ebtables etc that cannot be made to run in background?
3. Is there any freeware tool that helps find unused functions
correctly by parsing some huge C/C++ source code?

Any suggestions would be welcome.Thanks.


Re: Size Optimization for an embedded system

Quoted text here. Click to load it

-Wunused-function is a gcc option which you could consider for (3)

Re: Size Optimization for an embedded system

Quoted text here. Click to load it

I've never used it but you might look at
http://sourceforge.net/projects/libraryopt/


Re: Size Optimization for an embedded system
Quoted text here. Click to load it
athttp://sourceforge.net/projects/libraryopt/

Thank you. But libraryopt is a tool to reduce the shared libraries by
eliminating unused functions with respect to a set of binaries and not
the binaries itself.


Re: Size Optimization for an embedded system
Quoted text here. Click to load it

Why would you run the iptables program in the background? And what
difference to memory usage would it make?

The iptables program simply loads configuration data into the kernel
to control the kernel's netfilter functions.


Re: Size Optimization for an embedded system
Quoted text here. Click to load it

 Thanks a lot.I want to run iptables in the background (even for the
time it takes to add a rule or display all chains) because I do a cat /
proc/meminfo before the background application runs and while the
application is running in the background to find out the RAM
requirement.
Iptables might use malloc etc ..Since it makes its own data structures
before doing a final setsockopt() on the kernel,I think it would make
difference to  memory usage.


Re: Size Optimization for an embedded system

Quoted text here. Click to load it

You do a meminfo check before and after running iptables in order to get
the memory usage of iptables. Fine. But why do you think the memory reqs
are different? Also, how can you be sure that Iptables is "done" when
you have it in the bg when you run the meminfo check the second time?


Re: Size Optimization for an embedded system
wrote in part:
Quoted text here. Click to load it

Use an older kernel.  2.4 uses less RAM than 2.6 .

Quoted text here. Click to load it

`ps` and `top` are the standards.  They do  multiple-count
shared usage (libs).

Quoted text here. Click to load it

Your compiler should issue warnings.  Then you can lump all
the unused functions together to avoid wasting parts of pages.
Optimizing the library (find a good one) can be done to
the same end.

http://www.linuxlinks.com/Distributions/Mini_Distributions /
http://www.linuxrouter.org /

may give you some ideas.


-- Robert

Quoted text here. Click to load it

Re: Size Optimization for an embedded system
wrote in part:
Quoted text here. Click to load it
http://www.linuxlinks.com/Distributions/Mini_Distributions/http://www.linuxrouter.org /
Quoted text here. Click to load it
Thank u for ur input :)
I cannot use 2.4 neither ps or top are supported. I would try the
warnings part though



Re: Size Optimization for an embedded system
Quoted text here. Click to load it

What do you mean by 'not supported', compiling these tools for your
platform can't be that hard ?

--
:wq
^X^Cy^K^X^C^C^C^C

Re: Size Optimization for an embedded system

Quoted text here. Click to load it

With all due respect, that's utter nonsense.  I'm sure that Linux has
supported 'ps' since before version 1.0, by a sizable margin.  I
probably still have a CD from a time before RedHat was a word, to prove
it.  'top' may have come a bit later, but definitely before version 2.0.

[Please note and respect the F'up2]

Re: Size Optimization for an embedded system

Quoted text here. Click to load it

Really? Just how did you come to that erroneous conclusion?

--
http://www.spinics.net/lists/kernel /

Re: Size Optimization for an embedded system
Quoted text here. Click to load it

ps and top have memory requirements .The busybox that I use doesnt
have ps or top applets compiled into.I know I can compile them  into
it.I use the file /proc/meminfo - the very file ps and top use.kill
and top come in the Process utilities sections of busybox that can
very well be compiled to.


Re: Size Optimization for an embedded system
Quoted text here. Click to load it

And you are implying that's not true for a 2.6 kernel?

Quoted text here. Click to load it

None of which answeres the question of how you came to the
conclusion that 2.4 kernels don't support ps and top.

--
Grant Edwards                   grante             Yow!  Let's send the
                                  at               Russians defective
We've slightly trimmed the long signature. Click to see the full one.
Re: Size Optimization for an embedded system

Quoted text here. Click to load it

And what does any of that have to do with kernel versions?


--
http://www.spinics.net/lists /

Re: Size Optimization for an embedded system

Quoted text here. Click to load it

BUT why? i'm also interested to know like others that what on earth
you cann't use ps with 2.4? what linux port you are trying to use?
You may eliminate the unused drivers that your hardware will never
use. Is mini kernel an option to you?

ali


Re: Size Optimization for an embedded system
says...
Quoted text here. Click to load it

I think there has been a misunderstanding here.  I suspect the OP meant
something more like "I cannot use 2.4 and neither ps or top are
supported (in my setup)."

Robert

--

Re: Size Optimization for an embedded system
Quoted text here. Click to load it


Thanks Robert. I meant this only. I cannot use ps and top in my
setup .I am not saying anything about the availability/non
availability of ps and top with 2.4 !  I have already applied mini
kernel option. I just want to know of a tool that can give me dynamic
memory usage of an application that cannot be run on background!


Re: Size Optimization for an embedded system
Quoted text here. Click to load it

I.C. Cann't understand your point of dynamic memory;-)  Do you mean
that what memeory your process will use at runtime?
Anyway, just thought that if you area that much worried about your
memory and kernel size then how about removing the virtual memory
stuff at all. Don't know if its gonna work or not just a thought of
mine. Yeah, using physical addresses, for sure it will make life bit
hard but you maybe able to reduce the size drastically.

ali


Re: Size Optimization for an embedded system

Quoted text here. Click to load it

If you tell the compiler -ffunctions-section and then tell the
linker --gc-sections, unused functions will be discarded.
Adding the -fdata-sections to the compiler flags will do the
same thing for variables.

--
Grant Edwards                   grante             Yow!  .. the MYSTERIANS are
                                  at               in here with my CORDUROY
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline