Repository navigation
feat: Add RAM Frequency and Type to Environment Summary (#3041) - #3281
Conversation
…ll raw SMBIOS table
timcassell
left a comment
There was a problem hiding this comment.
Can you implement it for MacOS also?
Implement GetMacMemoryDetails() using system_profiler SPMemoryDataType to extract memory speed and type information on macOS, matching Windows and Linux implementations. Addresses feedback from @timcassell on PR #3281. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
Hi @timcassell, I implemented macOS support as requested. The new The implementation:
Ready for review. Let me know if you'd like any adjustments. |
…cs() Extract frequency and memory type detection into a dedicated method to match the architectural pattern used by Windows (GetWindowsSmbiosMemoryDetails) and Linux (GetLinuxOrWindowsMemoryDetails). Addresses feedback from @timcassell that implementation should use separate methods. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
Updated to address your feedback about separate methods. Refactored the macOS implementation: ✅ Created dedicated Ready for review. Commit: |
Use ProcessHelper.RunAndReadOutput instead of manual ProcessStartInfo calls in GetMacMemory() and GetMacMemorySpecs() to avoid potential deadlock when system_profiler output exceeds the stdout buffer size. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
I've confirmed latest CI logs. Though, it seems failed to gets detailed memory information and fallback path is used. And
|
- Convert MHz to MT/s (Megatransfers per second) for DDR memory types - Update FrequencyMHz property to FrequencyMts - Apply 2x multiplier: MT/s = MHz × 2 for DDR memory - Remove "Unspecified" filter from Linux memory type detection - Update unit label in output from MHz to MT/s Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Use non-whitespace pattern (\S+) instead of uppercase-only pattern to properly capture memory type strings like UDIMM, LRDIMM, etc. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
It wasn't explicitly requested in the issue, but it would be nice to include memory timings also, if the info is available. |
- Add CasLatency property to PhysicalMemoryInfo - Extract CAS latency from SMBIOS Type 17 offset 0x1C on Windows - Display in format: 8GB (DDR4-6400MT/s-CAS16) - Update unit tests to verify CAS latency property Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Replace regex-based parsing of localized system_profiler text with JSON output. This eliminates issues with different locales and handles varying output formats on different macOS versions. Changes: - Use system_profiler -json SPMemoryDataType instead of text parsing - Parse JSON with System.Text.Json for robustness - Filter out "Unknown" memory types from output - Extract speed and type from either direct properties or _properties array - Gracefully handle missing or malformed output Addresses feedback on regex fragility and locale-specific output variations.
Display 'GB Total' instead of just 'GB' to clarify total memory vs available memory. Output now shows: '16 GB Total (DDR4-6400MT/s-CAS16), 8 GB Available'
SMBIOS specification defines memory speed at offset 0x15 as MT/s, not MHz. Remove the DDR multiplication logic (speedMhz * 2) since the value is already in the correct unit. Also simplify CAS latency validation by removing the unnecessary cas < 100 guard, keeping only cas > 0. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- SMBIOS: read Configured Memory Speed (0x20) with rated Speed (0x15) as fallback, honor the 0xFFFF Extended Speed fields, skip empty slots, stop at end-of-table, and bound parsing by the RawSMBIOSData table length. - Remove CAS latency: SMBIOS type 17 has no timing fields (0x1C is the Extended Size low byte). - macOS: parse the real system_profiler keys (dimm_type/dimm_speed, Intel _items and Apple silicon layouts) without doubling the reported speed; give system_profiler a timeout. - Linux: read the SMBIOS table from /sys/firmware/dmi/tables/DMI when readable, falling back to EDAC with normalized type names. - Restore the shipped PhysicalMemoryInfo(long, long?) constructor and the "X GB" output when available memory is unknown. - Split the Windows/Linux detail helpers and extract testable parsers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The GitHub Actions macOS runners report "Unknown" (arm64) and "RAM" with a fake speed (x64) for dimm_type, so only use slots whose type names a real DRAM type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes #3041
Description
This PR implements the community-requested feature to read and display RAM frequency (MHz) and memory type (e.g., DDR4) in the environment summary.
It updates
PhysicalMemoryInfoto parse WMI (Win32_PhysicalMemory) on Windows and/usr/sbin/dmidecodeon Linux.Testing
PhysicalMemoryInfoTeststo validate memory info parsing without allocations.dotnet testpassed 100% on net10.0 and net8.0.