FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [September 2006 Threads] Monitor Avaliable RamPosted by Çağlar Akyüz on September 27, 2006 How can I estimate/monitor the size of free RAM?
I'm using LWiP Webserver Project under GCC for SAM7X. I know the theoric calculation and I think at least there should be 40k avaliable. However, I want to decide avaliable free ram at run time. I'm thinking of calling vPortMalloc and check for return value. Do you I have to arrange heap size or something else for this method to work?
Any other idea is also appreciated.
Regards
RE: Monitor Avaliable RamPosted by Nobody/Anonymous on September 28, 2006 The kernel heap is internally only used for allocation of RAM to tasks, queues and semaphores. Applications can of coarse use it for anything else they wish.
If your question is how much of the kernel heap RAM remains, rather then total RAM, then the answer depends on the heap implementation you are using.
I don't think you could use heap_1.c with lwIP as it does not implement free. If you were using heap_1 then you could just look at the xNextFreeByte variable.
heap_2.c implements free but does not merge free blocks. I think you could write a simple function that walks the chain of free blocks an adds up their totals.
heap_3.c just uses standard malloc() and free(). Is there a standard function call to ascertain the free heap in this case?
RE: Monitor Avaliable RamPosted by Çağlar Akyüz on September 28, 2006 I'm actually interested in Total RAM. Besides, I have some data between 32k-64k. I have SPI RAM for temporary storage and SPI flash for permament storage. I want to calculate how much internal SRAM I can use before using SPI RAMS.
Is it a good idea to increase heap size and dynamically allocate ram from heap or just should I decrease it as much as possible and use off-heap ram.
Thanks.
RE: Monitor Avaliable RamPosted by Nobody/Anonymous on September 28, 2006 I should decrease the heap so it just contains the RAM needed by the kernel. Then you can see what is what from your map file.
RE: Monitor Avaliable RamPosted by Nobody/Anonymous on September 28, 2006 utility for heap_2.c 2006-09-06 12:26 int vPortUsedMem(void) { xBlockLink *pxBlock = &xStart; int size = 0; vTaskSuspendAll(); while ((pxBlock) && (pxBlock != &xEnd)) { size += pxBlock->xBlockSize; pxBlock = pxBlock->pxNextFreeBlock; } xTaskResumeAll(); return size; } best rgs Janusz
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|