Glossary Updates12 new terms added to the glossaries · October 2, 2026, 22:44 CEST
AI TechDocKnowledge

Glossary · Automation software engineering and architecture

Dynamic memory allocation

Also known as: Heap allocation

German: Dynamische Speicherzuweisung

In programming, dynamic memory allocation is the reservation of memory at runtime from a heap, in amounts determined while the program runs, with the memory later released explicitly or by garbage collection. It contrasts with static allocation, where memory is reserved when the program is built or started.

  • Software engineering

In one sentence

Dynamic memory allocation reserves memory at runtime from a heap and releases it later, instead of reserving it at build time.

Example

The firmware coding rules forbid dynamic memory allocation after startup, so all message buffers are allocated once during initialization.

How it applies

  • Engineering: Dynamic allocation is flexible but brings risks: allocation can fail, memory can fragment, allocation time may be unpredictable and errors cause leaks or Dangling pointer defects. For these reasons, real-time and safety-related software often avoids it after initialization.
  • Standards: Coding standards for embedded and safety-related software, such as MISRA C, restrict dynamic memory use, and IEC 61508-3 lists its avoidance among recommended measures for higher integrity levels. Most IEC 61131-3 programs use static allocation by design.
  • Documentation: Developer documentation should state the project's memory allocation rules and memory budgets. For long-running systems, document how memory use is monitored, since slow leaks may only show after weeks of operation.

Dynamic allocation vs. garbage collection

With manual dynamic allocation, the program frees memory explicitly. Garbage collection frees memory automatically when it is no longer referenced, avoiding many errors but introducing pauses that can affect timing.

By knowledge.aitechdoc.world · Published September 26, 2026 · Last reviewed

Source: AI TechDoc Knowledge editorial definition, based on embedded and real-time software practice

Definitions follow the cited standards and specifications. Where a source is a copyrighted publication, such as an ISO, IEC or EN standard, the definition is a close paraphrase, not a verbatim quotation, so as not to infringe copyright. We recommend reading the original publication. The sections “How it applies” are editorial commentary by AI TechDoc Knowledge and are not part of any standard.

Seen a mistake? Send us a note!