GXEpd2 on an ESP32 Dev Board with 3 Displays and Memory Problems

Hi, I am trying to use 3x7.5 inch displays with an ESP32 Dev Module. It works fine with 2 displays but when I try to run 3 I get Compilation errors
Either

ping timeout

or

:/users/4d/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\4D\AppData\Local\Temp\arduino\sketches\ABA713C498B5CFC9DEE6D6B664DFEB86/30Days_3ScreensTest.ino.elf section `.dram0.bss' will not fit in region `dram0_0_seg'
c:/users/4d/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/users/4d/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/users/4d/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: region `dram0_0_seg' overflowed by 41552 bytes
collect2.exe: error: ld returned 1 exit status

Using library Wire at version 2.0.0 in folder: C:\Users\4D\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\Wire 
Using library SPI at version 2.0.0 in folder: C:\Users\4D\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\SPI 
Using library GxEPD2 at version 1.5.5 in folder: C:\Users\4D\Documents\Arduino\libraries\GxEPD2 
Using library Adafruit GFX Library at version 1.11.10 in folder: C:\Users\4D\Documents\Arduino\libraries\Adafruit_GFX_Library 
Using library Adafruit BusIO at version 1.16.1 in folder: C:\Users\4D\Documents\Arduino\libraries\Adafruit_BusIO 
exit status 1

Compilation error: exit status 1

I tested this on PlatformIO and the error that comes up is to do with memory issues

c:/users/4d/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\firmware.elf section `.dram0.bss' will not fit in region `dram0_0_seg'
c:/users/4d/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/users/4d/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/users/4d/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: region `dram0_0_seg' overflowed by 41336 bytes
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32dev\firmware.elf] Error 1

this is odd because with two displays not too much memory is used

RAM:   [====      ]  35.9% (used 117792 bytes from 327680 bytes)
Flash: [==        ]  21.8% (used 286305 bytes from 1310720 bytes)

my code is:

#include <Wire.h>
#include <SPI.h>
#include <GxEPD2.h>
#include <GxEPD2_BW.h>
#include <epd/GxEPD2_750_T7.h>
#include <Fonts/FreeMonoBold9pt7b.h>
#include <Fonts/FreeMonoBold12pt7b.h>
#include <Fonts/FreeMonoBold18pt7b.h>
#include <Fonts/FreeMonoBold24pt7b.h>

GxEPD2_BW<GxEPD2_750_T7, GxEPD2_750_T7::HEIGHT> ePaperDisplay1(GxEPD2_750_T7(/*CS=*/ 12, /*DC=*/ 13, /*RST=*/ 14, /*BUSY=*/ 15)); // GDEW075T7 800x480

GxEPD2_BW<GxEPD2_750_T7, GxEPD2_750_T7::HEIGHT> ePaperDisplay2(GxEPD2_750_T7(/*CS=*/ 2, /*DC=*/ 4, /*RST=*/ 27, /*BUSY=*/ 25)); // GDEW075T7 800x480

GxEPD2_BW<GxEPD2_750_T7, GxEPD2_750_T7::HEIGHT> ePaperDisplay3(GxEPD2_750_T7(/*CS=*/ 26, /*DC=*/ 35, /*RST=*/ 34, /*BUSY=*/ 33)); // GDEW075T7 800x480

void setup()
{
  // Initialize display 1
  ePaperDisplay1.init(115200, true, 2, false);
  ePaperDisplay1.setTextColor(GxEPD_BLACK);
  
  // Initialize display 2
  ePaperDisplay2.init(115200, true, 2, false);
  ePaperDisplay2.setTextColor(GxEPD_BLACK);

  // Initialize display 3
  ePaperDisplay3.init(115200, true, 2, false);
  ePaperDisplay3.setTextColor(GxEPD_BLACK);

  // Handle display 1 content
  ePaperDisplay1.firstPage();
  do
  {
    ePaperDisplay1.fillScreen(GxEPD_WHITE);
    ePaperDisplay1.setCursor(0, 50); // Position text at (0, 50) for display 1
    ePaperDisplay1.print("Hello World on Display 1!");
  }
  while (ePaperDisplay1.nextPage());

  // Handle display 2 content
  ePaperDisplay2.firstPage();
  do
  {
    ePaperDisplay2.fillScreen(GxEPD_WHITE);
    ePaperDisplay2.setCursor(0, 50); // Position text at (0, 50) for display 2
    ePaperDisplay2.print("Hello World on Display 2!");
  }
  while (ePaperDisplay2.nextPage());

  // Handle display 3 content
  ePaperDisplay3.firstPage();
  do
  {
    ePaperDisplay3.fillScreen(GxEPD_WHITE);
    ePaperDisplay3.setCursor(0, 50); // Position text at (0, 50) for display 3
    ePaperDisplay3.print("Hello World on Display 3!");
  }
  while (ePaperDisplay3.nextPage());
}

void loop() {};

I'm wondering if anyone can give me advice as I'd love to use 3 displays with one esp32 dev board

Is already too much static RAM used to work. Should be less than 64K.

Try with GxEPD2_750_T7::HEIGHT / 2>

thanks for the suggestion. Would this then cut the resolution of the screen in half?
thanks

No, it would only show half of the screen, without page loop.