Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds dev-only heap observability to help debug Aplite memory pressure (Issue #119) by instrumenting heap snapshots and low-watermark sampling around startup, AppMessage handling, layer lifecycle, and forecast redraws.
Changes:
- Add a
memory_log.hhelper with dev-only macros for heap snapshots and scoped low-watermark probes. - Sprinkle heap probes across watchface init/teardown, window/layer create/destroy, AppMessage receive/open, and forecast redraw/refresh.
- Enable the feature in dev builds via a build flag set from the generated package profile, and document usage in
AGENTS.md.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
wscript |
Reads build profile and injects FCW2_ENABLE_MEMORY_LOGGING CFLAG for dev builds. |
src/c/appendix/memory_log.h |
Introduces MEMORY_LOG_HEAP and heap probe macros (dev-only). |
src/c/watchface.c |
Adds heap snapshots around boot/init and teardown. |
src/c/windows/main_window.c |
Adds heap snapshots after load and around unload. |
src/c/appendix/app_message.c |
Logs forecast payload size and heap after app_message_open(). |
src/c/appendix/config.c |
Logs heap after config load/refresh. |
src/c/layers/forecast_layer.c |
Adds redraw low-watermark sampling and refresh-size heap logging. |
src/c/layers/weather_status_layer.c |
Adds heap snapshots around update/create/refresh/destroy. |
src/c/layers/time_layer.c |
Adds heap snapshots after create and around destroy. |
src/c/layers/loading_layer.c |
Adds heap snapshots after create and around destroy. |
src/c/layers/calendar_layer.c |
Adds heap snapshots after create and around destroy. |
src/c/layers/calendar_status_layer.c |
Adds heap snapshots after create and around destroy. |
src/c/layers/battery_layer.c |
Adds heap snapshots after create and around destroy. |
AGENTS.md |
Documents how to use the heap probe macros. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #119