ESP32 Eigen Library Crash: Program Crashes When Increasing matrix is too big

I’m trying to increase the resolution of an image by interpolating some data using the Eigen library. However, when I attempt to increase the number of sampling points from 24 to 25, the program crashes. Strangely, it works fine for all values up to 24. When I checked the memory usage, it shows that there’s plenty of free heap memory available (around 118KB). Even if I choose a sample size that doesn’t cause a crash, the heap memory remains unchanged after running for a while.( implies no memory leak?) The code crashes immediately, and I can’t get any output from either the loop or the setup when picking samples above 25.

Error message

ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
mode:DIO, clock div:2
entry 0x400805e4

assert failed: esp_startup_start_app_common port_common.c:81 (res == pdTRUE)

Backtrace: 0x40083885:0x3ffe3a60 0x40088565:0x3ffe3a80 0x4008d621:0x3ffe3aa0 0x4008b4b1:0x3ffe3bd0 0x400fa9b6:0x3ffe3c00 0x400dfd0b:0x3ffe3c20 0x40082f99:0x3ffe3c50 0x40079306:0x3ffe3c90 |<-CORRUPTED

ELF file SHA256: 8f6cbc45a5b8bbda

This also seems wrong to me.

RAM:   [=         ]   6.9% (used 22536 bytes from 327680 bytes)
Flash: [===       ]  27.4% (used 359429 bytes from 1310720 bytes)

I haven’t posted any code as I think this pose is already very long, if ne
Here is some data i collected, to me it seems like i should be able to get some more samples before crashing.
free heap mem = 118336 at samples = 24
free heap mem = 127880 at samples = 23
free heap mem = 137004 at samples = 22
free heap mem = 145740 at samples = 21
free heap mem = 154088 at samples = 20