On 4/21/2010 11:04 AM, Lennart Sorensen wrote: > when I do things like sleep or cp. Does anyone have any advice about how to > approach these issues? Should I try to write applications to handle these > things instead of using shell scripts? > > Well if your shell scripts run and terminate (freeing all the ram they > used as a result) and no other processes allocate any memory while they > run, then you should not have a problem from that. > > On the other hand if you do something like: > > launch a process from a startup script and background it > launch another process from startup script and background it, while > the first one is making memory allocations or calling external scripts > and commands > etc > > Then you are likely to end up causing a lot of fragmentation. > > I did find that making busybox as small as possible in the heap+bss+stack > usage made a big difference in how much memory was used and how fragmented > things got. In my case my busybox config was using 67KB, but by making > a few config changes (switch mv/cp buffer to malloc instead of stack and > remove a few unused features), I dropped that to 59KB. Of course 59KB > requires a 64KB chunk, while 67KB requires a 128KB chunk in the nommu > power of two allocator, so that suddenly makes each busybox command > require half as much memory, and hence only need half as big a chunk > of memory. Suddenly an 8MB machine was doing very well, where before a > shell script piping 4 or 5 commands together could make it run out of > ram (in big enough pieces, there were lots of 32 and 64KB chunks left > but those were not big enough to be useful). > >
What version of Busybox are you using? I am finding it difficult to make a newer version (1.15.x, 1.16.0) that small. In fact, when I configure it with a single applet, I still somehow get a ~200kB binary. Are there other options you are using in the build process to make your BB binary so small? -JB _______________________________________________ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev