Skip to content

Update memory accounting - #5979

Merged
akleshchev merged 3 commits into
release/26.3from
andreyk/viewer_4604_commit_charge
Jul 7, 2026
Merged

Update memory accounting#5979
akleshchev merged 3 commits into
release/26.3from
andreyk/viewer_4604_commit_charge

Conversation

@akleshchev

Copy link
Copy Markdown
Contributor
  1. Properly track commit charge on windows
  2. Report memory stats to bugsplat
  3. Fix virtual memory overflow

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the viewer’s memory accounting and reporting to better reflect Windows commit charge, add crash-time memory stats to BugSplat reports, and reduce risk of memory-stat overflows by switching certain accounting to MB units.

Changes:

  • Add Windows-only commit-availability tracking and expose it to texture memory-pressure logic.
  • Cache memory queries (physical + commit) behind a 1s timer to reduce repeated sampling overhead.
  • Extend BugSplat crash attributes with additional memory telemetry.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
indra/newview/llviewertexture.h Declares Windows-only commit-memory accessor for texture system.
indra/newview/llviewertexture.cpp Adds cached sampling and incorporates commit availability into low/critical memory checks on Windows.
indra/newview/llappviewerwin32.cpp Adds crash-time memory stats to BugSplat attributes.
indra/llcommon/llsys.h Changes LLMemoryInfo available-memory API to update internal cached stats rather than returning via out-param.
indra/llcommon/llsys.cpp Implements new memory stat update path; populates LLMemory-backed cached fields on Windows and other platforms.
indra/llcommon/llmemory.h Adds Windows-only commit-availability accessor and allows LLMemoryInfo to update LLMemory’s cached stats.
indra/llcommon/llmemory.cpp Adapts updateMemoryInfo() to new LLMemoryInfo API and exposes commit availability getter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread indra/newview/llappviewerwin32.cpp Outdated
Comment thread indra/newview/llviewertexture.cpp Outdated
Comment thread indra/llcommon/llsys.cpp Outdated
Comment thread indra/llcommon/llsys.cpp Outdated
Comment thread indra/llcommon/llsys.cpp Outdated
Comment thread indra/llcommon/llsys.cpp Outdated
Comment thread indra/llcommon/llsys.cpp Outdated
Comment thread indra/llcommon/llmemory.cpp Outdated
Comment thread indra/llcommon/llsys.cpp Outdated
Comment thread indra/llcommon/llsys.cpp Outdated
@akleshchev
akleshchev force-pushed the andreyk/viewer_4604_commit_charge branch from e851bfa to ec7a935 Compare July 6, 2026 18:19
@akleshchev
akleshchev force-pushed the andreyk/viewer_4604_commit_charge branch from ec7a935 to abad2c2 Compare July 6, 2026 18:59
@akleshchev
akleshchev requested a review from Copilot July 6, 2026 19:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

indra/llcommon/llsys.h:142

  • The comment says all stats-map values are in kilobytes, but this PR changes Windows virtual-memory values to be reported in megabytes (e.g., "Total Virtual MB"). Please update the comment to avoid misleading consumers.
    // Retrieve a map of memory statistics. The keys of the map are platform-
    // dependent. The values are in kilobytes to try to avoid integer overflow.
    LLSD getStatsMap() const;

Comment thread indra/llcommon/llsys.cpp Outdated
Comment thread indra/llcommon/llsys.cpp Outdated
Comment thread indra/llcommon/llsys.cpp
@akleshchev
akleshchev force-pushed the andreyk/viewer_4604_commit_charge branch from abad2c2 to 1f58c99 Compare July 7, 2026 04:29
@akleshchev
akleshchev requested a review from Copilot July 7, 2026 04:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Comment thread indra/llcommon/llsys.cpp
Comment thread indra/llcommon/llsys.cpp Outdated
Comment thread indra/llcommon/llsys.cpp Outdated
Comment thread indra/llcommon/llsys.h Outdated
@akleshchev
akleshchev force-pushed the andreyk/viewer_4604_commit_charge branch from 1f58c99 to be66eeb Compare July 7, 2026 05:35
@akleshchev
akleshchev requested a review from Copilot July 7, 2026 07:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Comment thread indra/newview/llviewertexture.cpp Outdated
Comment thread indra/newview/llviewertexture.cpp Outdated
Comment thread indra/llcommon/llmemory.cpp Outdated
@akleshchev
akleshchev force-pushed the andreyk/viewer_4604_commit_charge branch from be66eeb to 05eb6e7 Compare July 7, 2026 11:18
@akleshchev
akleshchev force-pushed the andreyk/viewer_4604_commit_charge branch from 05eb6e7 to 99dc81f Compare July 7, 2026 14:40
@akleshchev
akleshchev requested a review from Copilot July 7, 2026 14:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Comment thread indra/newview/llviewermessage.cpp Outdated
Comment thread indra/llcommon/llsys.h Outdated
Comment thread indra/llcommon/llmemory.cpp
Comment thread indra/llcommon/llmemory.cpp Outdated
Comment thread indra/llcommon/llmemory.cpp Outdated
@akleshchev
akleshchev force-pushed the andreyk/viewer_4604_commit_charge branch 2 times, most recently from c2a81bc to 500cf6c Compare July 7, 2026 14:51
@akleshchev
akleshchev requested a review from Copilot July 7, 2026 14:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Comment thread indra/newview/llvocache.cpp
Comment thread indra/newview/llviewermessage.cpp Outdated
Comment thread indra/newview/llviewerdisplay.cpp
Comment thread indra/newview/llappviewerwin32.cpp Outdated
Comment thread indra/llcommon/llsys.h Outdated
# Conflicts:
#	indra/newview/llappviewerwin32.cpp
@akleshchev
akleshchev force-pushed the andreyk/viewer_4604_commit_charge branch from 500cf6c to 1803fa2 Compare July 7, 2026 15:04
@akleshchev
akleshchev requested a review from Copilot July 7, 2026 15:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment thread indra/newview/llviewermessage.cpp
Comment thread indra/newview/llappviewerwin32.cpp Outdated
Comment thread indra/newview/llappviewerwin32.cpp Outdated
@akleshchev
akleshchev force-pushed the andreyk/viewer_4604_commit_charge branch from 1803fa2 to 24ea2d9 Compare July 7, 2026 15:33
@akleshchev
akleshchev merged commit 1c8144b into release/26.3 Jul 7, 2026
12 checks passed
@akleshchev
akleshchev deleted the andreyk/viewer_4604_commit_charge branch July 7, 2026 16:55
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants