What Is PSRAM? Wiring and Errors (2026)

What Is PSRAM? Wiring and Errors (2026)

PSRAM ("pseudo-static RAM") is extra memory that lives on a chip beside the main processor — it behaves like SRAM to your code but is built cheaply like DRAM. The ESP32 core only has about 520KB of internal SRAM, so boards with PSRAM bolt on 2, 4, or 8MB more for the big stuff.

Quick answer: PSRAM matters when a task needs more RAM than the ESP32's internal ~520KB — camera framebuffers, ML models, or large web pages. Enable via Arduino IDE Tools → PSRAM → Enabled, then plain malloc uses it automatically, or allocate explicitly via ps_malloc(). It's usable RAM, just slower — keep loop counters internal, reserve PSRAM for buffers.

Proof of work: the explanation below is Soldr's actual answer to "What is PSRAM and how do I use it?", asked through Compoden's AI build assistant on 12 August 2026. Published 12 August 2026 · Last updated 12 August 2026.

Soldr's answer explaining PSRAM: what it is, why the ESP32-CAM requires it, and the three levels of using it
Soldr's build log answering "What is PSRAM and how do I use it?" — the explanation from the same session.

Why does a camera board specifically require PSRAM?

A camera framebuffer is huge — an OV2640 sensor at VGA resolution wants around 300KB per frame, and streaming smoothly needs a few frames buffered at once, which the ESP32's ~520KB of internal SRAM can't comfortably hold alongside everything else running. That's why the ESP32-CAM requires PSRAM: boards without it fail camera init or drop frames instantly. The same shortage shows up running a small ML model, buffering audio, or serving large web pages — anything that needs more working memory than the chip's internal SRAM offers.

PSRAM at a glance
Question Answer
What is it? Extra RAM chip beside the processor, behaves like SRAM, built cheaply like DRAM
How much does it add? 2, 4, or 8MB, depending on the board
Trade-off Slower than internal SRAM — fine for buffers, not for tight loop variables
Who needs it? Camera boards, small ML models, audio buffering, large web pages

How do I turn PSRAM on and actually use it?

In the Arduino IDE, it's Tools → PSRAM → Enabled (OPI PSRAM if the board uses octal PSRAM). In ESP-IDF, it's menuconfig → Component config → ESP32-specific → Support for external, SPI-connected RAM. Once enabled, PSRAM joins the normal heap and plain malloc uses it automatically for larger allocations — no code changes required for most cases. When you want explicit control over what goes into PSRAM versus internal SRAM, allocate directly with ps_malloc(size), or the more precise heap_caps_malloc(size, MALLOC_CAP_SPIRAM). On an ESP32-CAM specifically, the camera driver grabs its framebuffers from PSRAM automatically once you select the right board profile, so basic camera work doesn't need any manual allocation at all.

Why is my code slower after I moved data into PSRAM?

PSRAM is genuinely slower to access than the ESP32's internal SRAM, so moving the wrong kind of data into it is a real performance cost, not a bug. The fix is knowing what belongs where: keep tight loop counters and interrupt-service-routine-adjacent variables in internal SRAM, and reserve PSRAM for larger, less latency-sensitive data — buffers, camera frames, and ML model weights. Despite the "pseudo" in its name, PSRAM is genuinely usable memory and your data survives reliably; the name refers to how the chip is built, not to any unreliability.

What do you need to try this yourself?

An ESP32-CAM Board (OV2640/OV3660) (Rs.670) is the board that answers this question directly — it carries 8MB of PSRAM, which is exactly why its 2MP camera can stream instead of stalling. Since the ESP32-CAM has no onboard USB port, add an ESP32-CAM-MB Programmer Module (CH340G) (Rs.95) to flash it.

Frequently asked questions

PSRAM ka matlab kya hota hai?

PSRAM ek extra memory chip hai jo processor ke saath lagi hoti hai - code ke liye yeh normal SRAM jaisi lagti hai, lekin banti sasti DRAM jaisi technology se hai. ESP32 ke paas sirf ~520 KB internal SRAM hoti hai, isliye camera ya bade data ke liye PSRAM waale boards use kiye jaate hain.

Why does my ESP32-CAM fail to initialize the camera?

The most common cause is PSRAM not being enabled - the camera driver needs it for framebuffers, and boards without PSRAM enabled (or without PSRAM hardware at all) will fail camera init or drop frames immediately. Check Tools → PSRAM → Enabled in the Arduino IDE first.

What is the price of an ESP32-CAM board in India?

The ESP32-CAM Board (OV2640/OV3660) costs Rs.670 at Compoden, with cash on delivery available across India. Since it has no onboard USB, a programmer module (Rs.95) is needed to flash it, bringing a working camera setup to Rs.765. Prices checked 12 August 2026.

Is PSRAM the same as the flash storage used for SPIFFS/LittleFS?

No - PSRAM is volatile working memory (it behaves like RAM and loses its contents on power-off), while flash storage is non-volatile and holds files between reboots. PSRAM extends how much a program can hold in memory while running; flash storage is a separate filesystem for persistent data.

Back to blog