My program crashes due to ran out of memory pages. I am developing under uClinux 2011 and BF548 EZKIT. How could I check the current remaining memory size? And is any way I can get more memories??
you can run cat /proc/buddyinfo to check if you have free chunk of memory large enough to support your memory allocation. Repeatedly malloc/free on Non-MMU system should be avoided, this would cause lots of fragmentation.
Thank for replying. When run cat /proc/buddyinfo, I get:
Node 0, zone DMA 2 2 2 0 3 2 2 1 0 1 2 3 1 0
Could you explain this information?? I have a little knowledge on memory management.
And refer to http://blackfin.uclinux.org/doku.php?id=linux-kernel:memory_allocation silly noMMU memory tricks, I can reverse some memories for my variable. Is this the proper way to solve the problem? I am building a program using Pocketsphinx API. The program fails when loading models for Pocketsphinx. I want to reverse some speech for these models.
means there are 2 chunks of 2 ^ 0 * PAGE_SIZE available, 3 chunks of 2 ^ 4 * PAGE_SIZE, etc, find a Linux kernel book for details. Yes reserve a memory pool for your application that requires frequent malloc/free is a good idea.
I followed MMP Kernel code example 2, did:
bfin>set bootargs root=/dev/mtdblock0 rw mem=50M max_mem=64M$#
root>mknod /dev/simple c 254 0
but I get "failed to mmap device: no such device". Could you tell me what's wrong?
Sorry I don't know the details of "MMP Kernel code exmaple 2" you mentioned, if you are trying to realize a memory pool, I would suggest you to use http://www.nedprod.com/programs/portable/nedmalloc/. We have customer using it and the performance is good.
Thank you for the information. I will try.
Retrieving data ...