Skip to content

perf(workspace): harden memory lifecycle, staging buffer disposal, and grid row cache cleanup - #671

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/670-memory-lifecycle-hardening
Aug 30, 2026
Merged

perf(workspace): harden memory lifecycle, staging buffer disposal, and grid row cache cleanup#671
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/670-memory-lifecycle-hardening

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Closes #670

Summary of Changes

  • DataGridStagingBuffer: Implemented explicit dispose() override that clears modified cells, inserted rows, and deleted row indices, immediately freeing heap allocations when staging is reset or discarded.
  • Workspaces (PostgresSqlWorkspace, MysqlSqlWorkspace, SqliteSqlWorkspace, ExtensionTableView):
    • Added explicit _stagingBuffer?.dispose() before allocating a new staging buffer on subsequent query executions, mutation saves, and table pagination.
    • Added clean disposal of _stagingBuffer in workspace dispose() lifecycle methods.
  • ResultsTab: Added dispose() override in _ResultsTabState to unbind memoized filtered rows (_cachedFilteredRows, _memoEffectiveRows) upon unmounting.
  • VirtualResultGrid: Added cache resets (_sortedRows = const [], _columnWidths = const [], _columnOffsets = const [0]) in VirtualResultGridState.dispose() to immediately release large matrix references to the GC.
  • Unit Tests: Added test in data_grid_staging_buffer_test.dart validating that dispose() clears internal collections and resets change tracking.

@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 6c47c6e into dev Aug 30, 2026
4 checks passed
@ZhuchkaTriplesix ZhuchkaTriplesix mentioned this pull request Aug 30, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue/670-memory-lifecycle-hardening branch August 30, 2026 19:01
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.

1 participant