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] [March 2017 Threads]
Hello guys
I just wanna ask you what is better using a dymanic memory allocation or a static one with freertos ?
That completely depends on your application and preference.
Dynamic is much easier to use, minimises the amount of RAM required as
memory is only allocated while it is actually required, but also means
the maximum required amount of RAM is harder to predict and adds a
little (if you are using a FreeRTOS heap implementation) non-determinism
and fragmentation risk. In most applications these risks don't exist in
practice.
Static requires more coding on the part of the application writer (you
have to allocated the objects by declaring variables), is a little more
complex as there are additional function parameters, normally creates a
higher maximum RAM usage as everything is always allocated whether it is
used or not, but is deterministic and the you know if you have enough
RAM a link time rather than run time. These last two points being why
static is normally preferred in safety critical applications.
http://www.freertos.org/StaticVsDynamicMemoryAllocation.html
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.