Skip to content

Conversation

@Seungwoo321
Copy link
Member

Summary

Fixes #270 - Critical memory leak causing memory to increase from 50MB to 881MB after 1000 refreshes.

Problem

  • Deep watch creating thousands of property watchers
  • Computed PivotData creating new instances on every access
  • No proper cleanup in component lifecycle

Solution

  • Remove deep: true from watch, use immediate: true instead
  • Replace computed PivotData with shallowRef to reuse instances
  • Add proper cleanup in onUnmounted lifecycle hook

Results

  • 94% memory reduction: 881MB → 53MB after 1000 refreshes
  • Stable memory usage even with continuous data updates
  • Component Key remains at 0 (no unnecessary recreations)

Testing

  • Tested with 1000+ data refreshes
  • Memory profiled using Chrome DevTools
  • Verified with different data sizes (1k, 5k, 10k records)

Breaking Changes

None - This is a internal optimization that doesn't affect the API.

Related Issue

Closes #270

- Remove deep watch causing excessive property watchers
- Replace computed PivotData with shallowRef
- Add proper cleanup in lifecycle hooks
- Achieve 94% memory reduction (881MB to 53MB)
@Seungwoo321 Seungwoo321 merged commit 0c9ef6b into develop Aug 6, 2025
2 checks passed
Seungwoo321 added a commit that referenced this pull request Aug 6, 2025
- Add v-model:pivotModel support to VPivottableUi component
- Implement PivotModel interface and comprehensive type system
- Fix filter changes to immediately reflect in PivotModel
- Modify props to Partial<DefaultPropsType> for flexible pivotModel usage
- Add PivotModel utility functions (compare, create, clone)
- Add PivotModel history management composable (usePivotModelHistory)
- Add PivotModel serialization/deserialization utilities
- Fix ESLint duplicate key error by renaming imported aggregators
- Merge memory leak fixes from PR #285
- Add comprehensive documentation in English and Korean

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
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