Troubleshooting memory remaining? And crashes in general?

I'm getting a crash whenever I re-read a file on my SPIFFS partition on my ESP32 and have been going crazy trying to figure out why.

I'm closing the file when I read it the first time.

And I just noticed that a completely unrelated variable is being assigned a value, which makes me suspect a memory leak or some other memory issue.

I've been using the Arduino IDE, and have the ESP Exception Decoder tool installed. Here's what it says on the crash:

PC: 0x00000000
EXCVADDR: 0x00000000

Decoding stack results
0x400da6a2: buildDB_from_fs() at C:\Users\wrybread\Documents\Arduino\fide1/fide1.ino line 2029
0x400db139: loop() at C:\Users\wrybread\Documents\Arduino\fide1/fide1.ino line 905
0x400e5415: loopTask(void*) at C:\Users\wrybread\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32\main.cpp line 19
0x4008e84d: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143

I don't imagine anyone has any idea?

And/or is there some way to monitor the memory usage?

When You compile/dowload, what does the compiler report say about memory usage?

I don't imagine anyone has any idea?

My guess is you have an error in your code. As you're hiding it from us you're the only one that is able to find the error.

Sorry, I should have included the compiler report. I think the relevant parts are:

Sketch uses 1081839 bytes (82%) of program storage space. Maximum is 1310720 bytes.
Global variables use 88136 bytes (26%) of dynamic memory, leaving 239544 bytes for local variables. Maximum is 327680 bytes.
C:\Users\wrybread\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\2.6.1/esptool.exe --chip esp32 --port COM13 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 C:\Users\wrybread\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4/tools/partitions/boot_app0.bin 0x1000 C:\Users\wrybread\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4/tools/sdk/bin/bootloader_qio_80m.bin 0x10000 C:\Users\wrybread\AppData\Local\Temp\arduino_build_352116/fide1.ino.bin 0x8000 C:\Users\wrybread\AppData\Local\Temp\arduino_build_352116/fide1.ino.partitions.bin 
esptool.py v2.6
Serial port COM13
Connecting....
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, Coding Scheme None
MAC: 30:ae:a4:45:d3:60
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...

Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 4369.1 kbit/s)...
Hash of data verified.
Compressed 17392 bytes to 11186...

Writing at 0x00001000... (100 %)
Wrote 17392 bytes (11186 compressed) at 0x00001000 in 0.2 seconds (effective 843.2 kbit/s)...
Hash of data verified.
Compressed 1081952 bytes to 619682...

Ok.
The first line tells that 82% of program memory is used. If the running sketch uses program memory
I can't tell. If it would, that could be worth looking closer at.
The second line tells that 26% of dynamic memory is used and that must be safe.

Attache the code in the same way as the info given earlier. Hopefully the best knowing helper will see something.

Program storage is completely irrelevant as it's only written at sketch upload time (exception jffs). Dynamic memory is more relevant but the number you got is only that part of the memory you use for global variables and constant strings.
You still failed to post the relevant information: your code. Everything you posted yet is irrelevant to debug your problem.