lowering OSPF memory requirements

Jack Culpepper jack at newdream.net
Tue Sep 2 23:19:44 CEST 2003


On Tue, Sep 02, 2003 at 08:38:03PM +0200, Martin Mares wrote:
> Hi!
> 
> > I am trying to use bird's OSPF implementation in a memory contrained linux
> > environment.  I have only 2 MB of RAM.  Can you give me some tips on how to
> > reduce the memory footprint of bird running OSPF?  It is currently using about
> > 1 MB, and I would like to try to cut that by 200 KB or so..
> 
> First of all, configure out all protocols you don't use.

A word about that..  Of "bgp ospf pipe rip static" I only want "ospf static".
Thus:

./configure --with-protocols=ospf,static
(works fine)

However, when I 'make':

.
.
m4 -P ../../conf/gen_commands.m4 ../../client/cmds.m4 ../../conf/confbase.Y ../../sysdep/unix/config.Y ../../sysdep/unix/krt.Y ../../sysdep/linux/netlink/netlink.Y  ../../nest/config.Y ../../filter/config.Y ../../proto/ospf/config.Y ../../proto/static/config.Y | sort >commands.h
m4 -P ../../conf/gen_parser.m4 ../../conf/confbase.Y ../../sysdep/unix/config.Y ../../sysdep/unix/krt.Y ../../sysdep/linux/netlink/netlink.Y  ../../nest/config.Y ../../filter/config.Y ../../proto/ospf/config.Y ../../proto/static/config.Y >cf-parse.y
bison -bcf-parse -dv -pcf_  cf-parse.y
cf-parse.y:1478: symbol DELAY is used, but is not defined as a token and has no rules
cf-parse.y:1478: symbol WAIT is used, but is not defined as a token and has no rules
cf-parse.y:1478: symbol BROADCAST is used, but is not defined as a token and has no rules
make[3]: *** [cf-parse.tab.c] Error 1
make[3]: Leaving directory `/home/jack/bird-1.0.6/obj/conf'
make[2]: *** [depend] Error 2
make[2]: Leaving directory `/home/jack/bird-1.0.6/obj'
make[1]: *** [.dep-stamp] Error 2
make[1]: Leaving directory `/home/jack/bird-1.0.6/obj'
make: *** [all] Error 2
% 

Is this easy to fix?

> Another thing which could help is switching off BIRD's smart allocators to the
> system ones which are slower, but more memory efficient. You can try changing
> "#undef FAKE_SLAB" in lib/slab.c to "#define FAKE_SLAB".

Thanks!  This is exactly the kind of tip I was hoping for.  I'll let the list
know what happens when I try this.

> (Untested, but could help a lot.) Try linking bird with diet libc (see
> http://www.fefe.de/dietlibc/) or uclibc (http://www.uclibc.org/).

Thanks, I have been linking with uclibc, which works fine at compile time.

> In any case, I'll be very glad to hear about the result.

It works, although after a while bird gets hung.  It doesn't crash, but sending
a SIGINT has no effect (before the hang this causes a graceful shutdown).
Instead, it simply stops advertising routes and sits in memory "running".  I
can kill it with a SIGKILL, but I have to reboot to get things working again.

I'm running 1.0.6.  BTW, I'm getting a lot of these errors:

nl_parse_link: Malformed message received

..perhaps this is related to the hanging.  Keep in mind that I am running this
on some little AMD ELAN boxes, with 1 MB flash and 2 MB RAM.  I have noticed
that the hanging happens much more often on one particular box than the rest,
though they are all running identical software.  I.e., this may be a hardware
issue (though it seems unlikely).

BTW, what is the difference in 1.0.7?  Is there are ChangeLog or ReleaseNotes
file somewhere?  I will try upgrading, but it would be nice to know what
changed..

Many, many thanks,

Jack



More information about the Bird-users mailing list