How much is my free memory?

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Jan 28 10:19:58 UTC 2014


On 2014-01-27 16:02, Federico Lenarduzzi wrote:
> Hi, I'm working with RTEMS for LPC1768. I need know how much memory is free for
> my application. I saw an article  where say that I can look at _Workspace_Area.
> If first == last, then there is only one free block of memory in the workspace
> (very likely if no task deletions). For example, If I do this:
>
> (gdb) p *(Heap Block *) _Workspace_Area->first
> $3 = {back flag = 1, front flag = 68552, next = 0x1e260, previous = 0x1e25c}
>
> I have 68552 bytes left in the workspace.
>
> Below, I will post my gdb command output. Note: I'm running hello.exe example:
>
> (gdb)  p *(Heap_Block *) _Workspace_Area->first_block
> $35 = {prev_size = 268439784, size_and_flag = 229, next = 0x101dd
> <_ARMV7M_Exception_default>, prev = 0x101dd <_ARMV7M_Exception_default>}
>
> The question is, How much is my free memory? I haven't "first" field on
> _Workspace_Area.

You can use rtems_workspace_get_information() or malloc_info() for this purpose.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list