Skip to content

Comments

fix: AIX memory statistics: add Available field and improve swap calculations#1982

Open
Dylan-M wants to merge 1 commit intoshirou:masterfrom
Dylan-M:dylanmyers/aix_mem
Open

fix: AIX memory statistics: add Available field and improve swap calculations#1982
Dylan-M wants to merge 1 commit intoshirou:masterfrom
Dylan-M:dylanmyers/aix_mem

Conversation

@Dylan-M
Copy link
Contributor

@Dylan-M Dylan-M commented Dec 23, 2025

Description

Improves memory statistics reporting on AIX systems by:

  1. Set Available memory field: The Available field is now explicitly set equal to Free memory, which is typically the case on AIX. This ensures consistent behavior with other platforms.

  2. Improve swap memory calculation: Refactored swap memory calculation to:

    • Explicitly track swap.Used
    • Calculate swap.UsedPercent as a percentage of total swap
    • Maintain consistency between Used and Free calculations

Part 4 of splitting #1969: mem package
Depends on #1979 #1980 #1981

Changes

  • Modified mem/mem_aix_nocgo.go:
    • Added comment and assignment for vmem.Available
    • Refactored swap memory calculation in callSVMon() function to properly track used swap and calculate usage percentage

Testing

  • Code formatted with gofmt
  • Verified with go vet - no issues found

@Dylan-M Dylan-M changed the title Fix AIX memory statistics: add Available field and improve swap calculations fix: AIX memory statistics: add Available field and improve swap calculations Dec 23, 2025
@Dylan-M Dylan-M marked this pull request as ready for review December 23, 2025 18:04
@Dylan-M Dylan-M force-pushed the dylanmyers/aix_mem branch from cd63eb7 to af34779 Compare January 24, 2026 14:42
@Dylan-M Dylan-M force-pushed the dylanmyers/aix_mem branch from af34779 to 0fa1bb4 Compare January 26, 2026 14:41
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.

1 participant