Bird
0
0

Given FreeRTOS is configured with heap_1 scheme, what happens if you try to free memory allocated by pvPortMalloc()?

medium📝 Predict Output Q13 of 15
FreeRTOS - Memory Management
Given FreeRTOS is configured with heap_1 scheme, what happens if you try to free memory allocated by pvPortMalloc()?
AMemory is freed successfully without errors
BFree operation is ignored; memory is not freed
CSystem crashes due to invalid free
DMemory is freed but causes fragmentation
Step-by-Step Solution
Solution:
  1. Step 1: Understand heap_1 behavior

    heap_1 only supports allocation; it does not support freeing memory blocks.
  2. Step 2: Effect of calling free in heap_1

    Calling free is ignored silently; memory is not actually freed, so no crash occurs.
  3. Final Answer:

    Free operation is ignored; memory is not freed -> Option B
  4. Quick Check:

    heap_1 ignores free calls [OK]
Quick Trick: heap_1 does not free memory, free calls are ignored [OK]
Common Mistakes:
  • Assuming free works normally in heap_1
  • Expecting a system crash on free
  • Thinking fragmentation is handled in heap_1

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes