---
type: Sensor Reference
title: "SNMP Memory & Swap OIDs: hrStorage & UCD Reference"
description: "The SNMP OIDs for memory and swap — hrStorageTable rows and UCD memory scalars — with a snmpwalk example and the allocation-unit conversion."
resource: "https://snmp-monitoring.info/sensors/memory/"
tags: [sensors]
timestamp: 2026-07-11T00:00:00Z
---

# SNMP Memory & Swap OIDs: hrStorage & UCD Reference

The SNMP OIDs for memory and swap — hrStorageTable rows and UCD memory scalars — with a snmpwalk example and the allocation-unit conversion.

## Related concepts

- Up: [SNMP Sensors & OID Catalog: Every Metric You Can Monitor](/sensors/index.md)

## Frequently asked questions

### What is the OID for RAM in SNMP?

The portable answer is the hrStorageTable RAM row — pick the row typed hrStorageRam, then read hrStorageSize (1.3.6.1.2.1.25.2.3.1.5) and hrStorageUsed (.6), multiplying by hrStorageAllocationUnits (.4) for bytes. On Net-SNMP hosts, memTotalReal (1.3.6.1.4.1.2021.4.5) and memAvailReal (.6) give it directly in kB.

### What OID is swap?

Swap is the hrStorageTable row typed hrStorageVirtualMemory, read the same way as the RAM row. On UCD/Net-SNMP agents, use memTotalSwap (1.3.6.1.4.1.2021.4.3) and memAvailSwap (1.3.6.1.4.1.2021.4.4) for total and free swap in kB.

### How do I convert the storage value to bytes?

Multiply the value by the row's allocation units: bytes = hrStorageSize × hrStorageAllocationUnits. The size and used columns are counts of fixed-size blocks (commonly 1024 or 4096 bytes), not bytes themselves. For a used percentage you can skip the conversion, since used ÷ size is already unitless.

### hrStorage or UCD memory — which should I use?

Use hrStorageTable for cross-vendor portability; it's implemented almost everywhere. Use the UCD scalars (1.3.6.1.4.1.2021.4) on Net-SNMP/Linux hosts where you want clean kB values without walking a table. Where both exist they should agree closely.

## Source

Concept generated from https://snmp-monitoring.info/sensors/memory/ — the SNMP Monitoring vendor-neutral knowledge base. Content is limited to what that page states (no external claims added here).
