This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Critical memory usage cause application keep reboot?
- From: Bart Veer <bartv at ecoscentric dot com>
- To: iucgnaw at msn dot com
- Cc: ecos-discuss at sourceware dot org
- Date: 13 Feb 2007 10:30:01 +0000
- Subject: Re: [ECOS] Critical memory usage cause application keep reboot?
- References: <BAY110-F107A9258D0388AEFEC9F80A5900@phx.gbl>
>>>>> " " == wang cui <iucgnaw@msn.com> writes:
> As I try MicroWindow demo with VNC, my program keep reboot
> after run for a while. Finally I found the memory usage is too
> critical, the BSS region almost touch top of RAM region. After
> I reduced some memory configuration, it works.
> Because it can't be found at compile time. So I am asking, is
> there a good way to detect this kind of potential problem?
mallinfo() provides some very basic information about heap usage, and
it can be useful to call this from your application at regular
intervals. e.g.
#include <stdlib.h>
...
{
struct mallinfo malloc_info = mallinfo();
diag_printf(" malloc info: allocated %d, free %d, maxfree %d\n",
malloc_info.uordblks, malloc_info.fordblks, malloc_info.maxfree);
}
eCosPro has added functionality for more advanced heap analysis, e.g.
tracking down memory leaks. See
http://www.ecoscentric.com/ecospro/doc/html/ref/memalloc.html for more
details. This is not currently available in the anoncvs version.
Bart
--
Bart Veer eCos Configuration Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts
Besuchen Sie uns vom 13.-15.02.07 auf der Embedded World 2007, Stand 11-336
Visit us at Embedded World 2007, Nürnberg, Germany, 13-15 Feb, Stand 11-336
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss