Skip to content

Commit 2085e28

Browse files
authored
Document analyze-memory CLI command (#5499)
1 parent 0ff4f2d commit 2085e28

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

content/guides/cli.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,23 @@ If set, opens the dashboard UI in a browser once the server is up and running. D
245245
`--socket`.
246246
{{< /option >}}
247247

248+
### `analyze-memory` Command
249+
250+
> [!NOTE]
251+
> This is an advanced command primarily intended for developers and debugging memory issues.
252+
253+
The `esphome analyze-memory <CONFIG>` command compiles the configuration and analyzes memory usage by component.
254+
255+
This command is useful for:
256+
257+
* Understanding which components are consuming the most memory
258+
* Identifying optimization opportunities to reduce flash or RAM usage
259+
* Analyzing memory usage before adding more components to a tight build
260+
* Debugging builds that are approaching memory limits (especially on ESP8266)
261+
* Contributing to ESPHome development and optimization efforts
262+
263+
The command automatically compiles the configuration if needed (or quickly relinks if sources haven't changed), then analyzes the resulting firmware to show a detailed breakdown of memory usage by component, including flash memory (code and data) and RAM usage (data and BSS).
264+
248265
### `logs` Command
249266

250267
The `esphome logs <CONFIG>` command validates the configuration and shows all logs.

0 commit comments

Comments
 (0)