[uClinux-dev] How to know what's taking place in memory
Fabrice_Gautier at sdesigns.com
Tue Nov 27 20:28:06 EST 2001
> -----Original Message-----
> From: David McCullough [mailto:davidm at snapgear.com]
> Subject: Re: [uClinux-dev] How to know what's taking place in memory
> > At the beggining I have this message:
> > Memory: 1MB = 1MB total
> > Memory: 304KB available (388K code, 150K data, 28K init)
> > If I do 304 + 388 + 150 + 28, i'm far from the 1mb total.
> What does thsi
> > figures really mean?
> These sizes are raw, not operational size. I am not 100% but
> I would think
> that the rest is lost to runtime memory allocation by the kernel.
> Do you have you romfs in ROM or RAM ?
In RAM. Actually i have a 2.0.x kernel on ROM, and running on ROM, and the
same line report code = 0K. So this would sure free some mem to have it in
> > This mean that some part of the kernel is allocating and
> freeing memory
> > before init.
> Quite possible. Any kernel threads will allocate memory for the task
> structures etc. Some drivers may allocate memory when they startup.
But which one would free something soon after? The only thing i can think of
that would fragment the memory would be the init segment which is freed at
some time, but that's 28k
> The easiest way if you have a debugger will be to stop on kmalloc and
> page_alloc routines and see who is calling them during
> startup, and how
> much they are using. You may find someone who can be reduced.
Yes, but BTW how do people usually debug kernel on that kind of case? Right
no i'm using the ARM debugger with multiICE trought the JTAG interface of
the board. Unfortunately a bug in this debugger make it impossible to have a
call stack of functions so this is quite difficult.
> You init seems quite large at
> 91K, perhaps
> you should try a smaller one like simple-init.c from userland or the
> uClinux distro's,
It's busybox, so i got a shell in there too. But i actually think that
uClibc is taking most of the space in there. The actual size of the shell
itself in busybox is about 10k.
This message resent by the uclinux-dev at uclinux.org list server http://www.uClinux.org/
More information about the uClinux-dev