Skip to content

ENH: Add GetSystemMemoryInfo() to MemoryUtilities#1556

Merged
imikejackson merged 2 commits intoBlueQuartzSoftware:developfrom
imikejackson:topic/memory_stats_utility
Mar 4, 2026
Merged

ENH: Add GetSystemMemoryInfo() to MemoryUtilities#1556
imikejackson merged 2 commits intoBlueQuartzSoftware:developfrom
imikejackson:topic/memory_stats_utility

Conversation

@imikejackson
Copy link
Contributor

Extend nx::core::Memory with a SystemMemoryInfo struct and GetSystemMemoryInfo() function that returns a cross-platform snapshot of:

  • totalGB — total installed physical RAM
  • usedGB — currently used RAM (total - available)
  • loadPercent — system memory load percentage
  • processGB — resident memory of the current process

Platform implementations:

  • Windows: GlobalMemoryStatusEx + GetProcessMemoryInfo (WorkingSetSize)
  • macOS: hw.memsize sysctl, HOST_VM_INFO64 vm_statistics,
    TASK_VM_INFO phys_footprint
  • Linux: /proc/meminfo (free-command formula) + /proc/self/statm

@imikejackson imikejackson requested a review from nyoungbq March 3, 2026 17:35
@imikejackson imikejackson requested a review from nyoungbq March 4, 2026 04:40
Extend nx::core::Memory with a SystemMemoryInfo struct and
GetSystemMemoryInfo() function that returns a cross-platform snapshot of:
  - totalGB    — total installed physical RAM
  - usedGB     — currently used RAM (total - available)
  - loadPercent — system memory load percentage
  - processGB  — resident memory of the current process

Platform implementations:
  - Windows: GlobalMemoryStatusEx + GetProcessMemoryInfo (WorkingSetSize)
  - macOS:   hw.memsize sysctl, HOST_VM_INFO64 vm_statistics,
             TASK_VM_INFO phys_footprint
  - Linux:   /proc/meminfo (free-command formula) + /proc/self/statm

No Qt dependency; pure C++ / OS headers only.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@imikejackson imikejackson force-pushed the topic/memory_stats_utility branch from 5764cfd to d1d1469 Compare March 4, 2026 04:40
@imikejackson imikejackson enabled auto-merge (squash) March 4, 2026 04:44
@imikejackson imikejackson merged commit 32c9873 into BlueQuartzSoftware:develop Mar 4, 2026
6 checks passed
@imikejackson imikejackson deleted the topic/memory_stats_utility branch March 4, 2026 15:04
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