Skip to content

Conversation

@ernestii
Copy link
Contributor

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Apr 19, 2025

⚠️ No Changeset found

Latest commit: 621491e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Apr 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hyperdx-v2-oss-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 22, 2025 2:41pm

@ernestii ernestii requested review from Copilot and knudtty April 19, 2025 02:03
Copy link

Copilot AI left a 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();

@teeohhem
Copy link
Contributor

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.

@kodiakhq kodiakhq bot merged commit d1cd667 into v2 Apr 22, 2025
5 of 6 checks passed
@kodiakhq kodiakhq bot deleted the ernest/hdx-1606-frontend-memory-leak-on-live-tail branch April 22, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants