-
Notifications
You must be signed in to change notification settings - Fork 341
fix: Optimize live tail memory #764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Optimize live tail memory #764
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR optimizes live tail memory usage by introducing a cache page limit for live data and by pausing live updates when the document is not visible.
- Added a new maxPages parameter to limit the cache in live data scenarios.
- Integrated document visibility checks to prevent unnecessary live updates when the user’s tab is inactive.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/app/src/hooks/useOffsetPaginatedQuery.tsx | Added a maxPages setting to aggressively limit cached pages for live data. |
| packages/app/src/DBSearchPage.tsx | Introduced document visibility checks to pause live updates when the tab is hidden. |
Comments suppressed due to low confidence (2)
packages/app/src/hooks/useOffsetPaginatedQuery.tsx:306
- Consider adding tests to verify that the maxPages option effectively limits the cached pages for live data scenarios.
maxPages: isLive ? 5 : undefined, // Limit number of pages kept in cache for live data
packages/app/src/DBSearchPage.tsx:809
- Consider adding tests to verify that live updates pause correctly when the document is not visible.
const isTabVisible = useDocumentVisibility();
|
This PR solves the issue with the amount of data we cache + pausing live tail when the tab isn't visible/active. There are other legit memory leaks/issues that are attached to the ticket that I will spawn off as lower pri in the backlog. |
No description provided.