Skip to content

Memory Size information

Phil Schatzmann edited this page Jun 12, 2025 · 1 revision

You can use the following methods to get the total bytes and free bytes for each memory region:

#include "esp32-psram.h"

void setup() {
  Serial.begin(115200);
  Serial.println(PSRAM.totalBytes());
  Serial.println(PSRAM.freeBytes());
  Serial.println(HIMEM.totalBytes());
  Serial.println(HIMEM.freeBytes());
}
Clone this wiki locally