Skip to content

Avoid loading full container snapshot table in dashboard queries#198

Merged
LarsLaskowski merged 1 commit into
mainfrom
claude/efcore-out-of-memory-9fsydk
Jul 22, 2026
Merged

Avoid loading full container snapshot table in dashboard queries#198
LarsLaskowski merged 1 commit into
mainfrom
claude/efcore-out-of-memory-9fsydk

Conversation

@LarsLaskowski

Copy link
Copy Markdown
Owner

GetLatestContainerSnapshotsAsync materialized the entire ContainerSnapshots table with all navigation includes before selecting the latest state in memory, which exhausted memory as snapshot history grew and produced OutOfMemoryException on the dashboard and runtime container pages. The selection now runs in the database: the latest runtime scan run per instance is resolved from a lightweight distinct projection, and instances without a runtime scan fall back to a per-container greatest-record subquery. Only the small final result set is materialized. Add a regression test covering the historical-snapshot fallback collapse.

GetLatestContainerSnapshotsAsync materialized the entire ContainerSnapshots table with all navigation includes before selecting the latest state in memory, which exhausted memory as snapshot history grew and produced OutOfMemoryException on the dashboard and runtime container pages. The selection now runs in the database: the latest runtime scan run per instance is resolved from a lightweight distinct projection, and instances without a runtime scan fall back to a per-container greatest-record subquery. Only the small final result set is materialized. Add a regression test covering the historical-snapshot fallback collapse.
@sonarqubecloud

Copy link
Copy Markdown

@LarsLaskowski
LarsLaskowski merged commit 24a0ae8 into main Jul 22, 2026
4 checks passed
@LarsLaskowski
LarsLaskowski deleted the claude/efcore-out-of-memory-9fsydk branch July 22, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants