Skip to content

Commit

Permalink
Add SMBIOSMemoryType values (#2627)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbwiddis committed Apr 13, 2024
1 parent eafc488 commit 9d8a276
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* [#2612](https://github.com/oshi/oshi/pull/2612): Use 1k buffer in FileUtils.readLines to reduce heap allocation pressure - [@chrisribble](https://github.com/chrisribble).
* [#2621](https://github.com/oshi/oshi/pull/2621): Cache thread counters when updating OS Process with suspended state - [@dbwiddis](https://github.com/dbwiddis).
* [#2626](https://github.com/oshi/oshi/pull/2626): Make sys and dev paths on Linux configurable - [@dbwiddis](https://github.com/dbwiddis).
* [#2627](https://github.com/oshi/oshi/pull/2627): Add more SMBIOSMemoryType values - [@dbwiddis](https://github.com/dbwiddis).

# 6.5.0 (2024-03-10)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ public List<PhysicalMemory> getPhysicalMemory() {
* @return A string describing the type
*/
private static String memoryType(int type) {
// https://schemas.dmtf.org/wbem/cim-html/2.55.0/CIM_PhysicalMemory.html
switch (type) {
case 0:
return "Unknown";
case 1:
return "Other";
case 2:
Expand Down Expand Up @@ -153,13 +156,12 @@ private static String memoryType(int type) {
case 21:
return "DDR2";
case 22:
return "DDR2-FB-DIMM";
case 24:
return "DDR3";
case 25:
return "FBD2";
return "BRAM";
case 23:
return "DDR FB-DIMM";
default:
return "Unknown";
// values 24 and higher match SMBIOS types
return smBiosMemoryType(type);
}
}

Expand All @@ -170,8 +172,8 @@ private static String memoryType(int type) {
* @return A string describing the type
*/
private static String smBiosMemoryType(int type) {
// https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.2.0.pdf
// table 76
// https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.7.0.pdf
// table 77
switch (type) {
case 0x01:
return "Other";
Expand Down Expand Up @@ -227,6 +229,16 @@ private static String smBiosMemoryType(int type) {
return "LPDDR4";
case 0x1F:
return "Logical non-volatile device";
case 0x20:
return "HBM";
case 0x21:
return "HBM2";
case 0x22:
return "DDR5";
case 0x23:
return "LPDDR5";
case 0x24:
return "HBM3";
case 0x02:
default:
return "Unknown";
Expand Down

0 comments on commit 9d8a276

Please sign in to comment.