In short
- Definition: The efficient use of memory by a system, avoiding waste and leaks.
- Goal: Run reliably on the target hardware and reduce infrastructure cost.
- Example S.M.A.R.T. requirement: Under 512 MB per instance at peak load, and no memory growth over a 72-hour soak test.
1. Definition
As a non-functional requirement, memory optimization describes the efficient use of memory (RAM) by a system: using no more than needed, and releasing it when no longer used [1], [2], [3].
A memory leak is a crash scheduled for later. Soak tests reveal the date.Key takeaway
Memory problems take two main forms. High consumption limits how many users or instances a server can handle and raises cost. Memory leaks, where memory is never released, make usage grow over time until the system slows down or crashes.
Memory matters everywhere: in containers with fixed limits, on mobile devices that close greedy apps, and on embedded hardware with very little RAM.
2. Goal
The goal is to run reliably on the target hardware and to reduce infrastructure cost.
Memory waste forces bigger servers, causes out-of-memory crashes and makes performance degrade over the day.
3. How to Measure It (S.M.A.R.T.)
| Metric | Unit | Typical target | How to measure |
|---|---|---|---|
| Memory per instance at peak | MB | < 512 MB | Monitoring under load test |
| Memory growth over time | MB per hour in a soak test | 0 after warm-up | 72-hour soak test |
| Out-of-memory events | Count per month | 0 | Container or OS events |
| Garbage collection pauses | Milliseconds | < 50 ms at the 99th percentile | Runtime metrics |
4. Example Requirements
Each requirement below is ready to copy into a specification: specific, measurable, achievable, relevant and time-bound.
- Service: “Each service instance shall use less than 512 MB of memory at peak load and show no memory growth over a 72-hour soak test.”
- Mobile app: “The app shall use less than 200 MB of memory on the reference phone during normal use.”
- Embedded: “The firmware shall run within 64 MB of RAM with at least 15% free at peak.”
5. Questions to Ask Stakeholders
- What memory limits apply on servers, containers or devices?
- How long does the system run without restart?
- What is the expected peak load?
- Are there large datasets loaded in memory?
- How will memory be monitored in production?
- Is there a soak test in the test plan?
6. Common Pitfalls
- Testing only short runs. Leaks appear after hours or days. Run soak tests.
- Caching without limits. Caches grow until memory runs out. Bound and expire them.
- Ignoring container limits. Processes may not see the container’s limit and get killed.
7. Related NFRs
- Categories of Non-Functional Requirements — the full checklist of NFR categories.
- Efficiency — memory is one of the key resources.
- Resource Constraints — sets the memory limits.
- Stability — leaks cause degradation and crashes over time.
- Performance — excessive memory use can slow the system.
8. FAQ
Memory that a program allocates but never releases, so usage keeps growing.
A long test, often 24 to 72 hours, at normal load to reveal leaks and slow degradation.
No. References kept by mistake, for example in caches or listeners, still leak memory.
9. Acronyms, Initialisms & Terms
Acronyms are abbreviations pronounced as words (like NASA); initialisms are spelled out letter by letter (like FBI). The classification below follows common pronunciation.
Acronyms
| Abbreviation | Stands for | Definition | Ref. |
|---|---|---|---|
| RAM | Random-access memory | The fast, temporary working memory a computer uses while programs run. | [4] |
| SMART | Specific, Measurable, Achievable, Relevant, Time-bound | Criteria for writing a goal or requirement so that anyone can check whether it has been met. | [5] |
Initialisms
| Abbreviation | Stands for | Definition | Ref. |
|---|---|---|---|
| FAQ | Frequently asked questions | List of common questions with their answers. | [6] |
| MB | Megabyte | Unit of data size, about one million bytes. | [7] |
| NFR | Non-functional requirement | Requirement that describes how well a system must work (its qualities, such as speed or security) rather than what it does. | [3] |
| OS | Operating system | Core software that runs a computer or phone, such as Windows, macOS, Linux, Android or iOS. | [8] |
Terms
Plain-language definitions of technical and project-management terms used in this article.
| Term | Plain-language definition | Ref. |
|---|---|---|
| Cache | Fast temporary storage of frequently used data to avoid recomputing or refetching it. | [9] |
| Container | Package that bundles an application with everything it needs to run, isolated from other software. | [10] |
| Garbage collection | Automatic freeing of memory a program no longer uses. | [11] |
| Load test | Test that simulates the expected number of users or requests to check how the system behaves. | [12] |
| Memory leak | Bug where a program keeps memory it no longer needs, so its usage grows over time. | [1] |
| Percentile | Value below which a given share of measurements falls; “95th percentile under 300 ms” means 95% of requests are faster than 300 ms. | [13] |
| Production environment | The live system that real users use, as opposed to test environments. | [14] |
| Stakeholder | Person or group with an interest in the system: users, sponsors, operators, regulators. | [15] |
10. Sources and Further Reading
- [1] “Memory leak.” Wikipedia. https://en.wikipedia.org/wiki/Memory_leak (accessed Nov. 18, 2026).
- [2] “Soak testing.” Wikipedia. https://en.wikipedia.org/wiki/Soak_testing (accessed Nov. 18, 2026).
- [3] “Non-functional requirement.” Wikipedia. https://en.wikipedia.org/wiki/Non-functional_requirement (accessed Nov. 18, 2026).
- [4] “Random-access memory.” Wikipedia. https://en.wikipedia.org/wiki/Random-access_memory (accessed Nov. 19, 2026).
- [5] “SMART criteria.” Wikipedia. https://en.wikipedia.org/wiki/SMART_criteria (accessed Nov. 19, 2026).
- [6] “FAQ.” Wikipedia. https://en.wikipedia.org/wiki/FAQ (accessed Nov. 19, 2026).
- [7] “Megabyte.” Wikipedia. https://en.wikipedia.org/wiki/Megabyte (accessed Nov. 19, 2026).
- [8] “Operating system.” Wikipedia. https://en.wikipedia.org/wiki/Operating_system (accessed Nov. 19, 2026).
- [9] “Cache (computing).” Wikipedia. https://en.wikipedia.org/wiki/Cache_(computing) (accessed Nov. 19, 2026).
- [10] “Containerization (computing).” Wikipedia. https://en.wikipedia.org/wiki/Containerization_(computing) (accessed Nov. 19, 2026).
- [11] “Garbage collection (computer science).” Wikipedia. https://en.wikipedia.org/wiki/Garbage_collection_(computer_science) (accessed Nov. 19, 2026).
- [12] “Load testing.” Wikipedia. https://en.wikipedia.org/wiki/Load_testing (accessed Nov. 19, 2026).
- [13] “Percentile.” Wikipedia. https://en.wikipedia.org/wiki/Percentile (accessed Nov. 19, 2026).
- [14] “Deployment environment.” Wikipedia. https://en.wikipedia.org/wiki/Deployment_environment (accessed Nov. 19, 2026).
- [15] “Project stakeholder.” Wikipedia. https://en.wikipedia.org/wiki/Project_stakeholder (accessed Nov. 19, 2026).
Written by Philippe Huard · LinkedIn · Last updated: November 18, 2026 · Header photo by @possessedphotography; inline photo by @liam_1, both on Unsplash.








