Glossary · Automation software engineering and architecture
Memory leak
German: Speicherleck
In software engineering, a memory leak is a defect in which a program keeps allocated memory it no longer needs, so available memory shrinks over time until performance degrades or the program fails.
- Software engineering
In one sentence
A memory leak is a defect where a program never releases memory it no longer needs, so free memory shrinks until the system slows or fails.
Example
An HMI application allocates a new buffer for every alarm message but never frees it; after three weeks of operation the panel freezes.
How it applies
- Operation: Leaks are typical long-run failures: the software passes every short test and fails only after days or weeks of continuous operation, which is normal for machines and plants.
- Verification: Endurance tests, memory profilers and Dynamic code analysis find leaks; monitoring memory use in the field through Observability tooling shows a slow upward trend before failure.
- Documentation: Known leaks and their workarounds (for example a scheduled restart) belong in the Release note and in the troubleshooting section of the manual until a fix is released.
Memory leak vs. dangling pointer
A memory leak keeps memory that should be released; a Dangling pointer refers to memory that was already released. Both are errors in managing Dynamic memory allocation, but a dangling pointer typically causes corrupted data or crashes, while a leak causes gradual exhaustion.