I have planned to do a somewhat complex project, I already did it on an Arduino as a test, but now I want to do it on the ESP8266 because supposedly I can use up to 4MB of flash memory. But loading an empty sketch says that I can only use almost 1MB (on top of that it uses 24% of that memory even when there is nothing). And with the RAM I can only use 82KB and also it uses 33% even with the sketch empty (I don't need a lot of RAM for my project, but it would be good not to waste it meaninglessly).
I have seen in some publications things about SPIFFS, OTA, SPI memory, etc. but Im something new in the world of ESP8266 and I DONT UNDERSTAND why SO MUCH memory disappears. I also saw that most solutions only gave for 2MB or having to replace the SPI flash chip with a bigger one (at most 16MB to only be able to use 8MB).
I would be very grateful if someone explained to me:
1. How to use the maximum capacity of flash memory (if its possible to use 4MB, but Im satisfied with 2MB).
2. If possible, change the SPI flash chip to a 16MB one.
3. If possible don't waste those 24% and 33% of flash and RAM memory.