ESP8266, the well known WiFi module contains an ESP8266EX SoC IC and an external SPI flash. This external SPI flash is used together with ESP8266EX to store user programs.
The supported size of flash by ESP8266EX is up to 16MB but some of ESP8266 modules contain flash chips with low storage capacity like 512KB. In some cases you need more space. For example, if the upgrade Over The Air “OTA is enabled: the minimum flash memory that can be supported is 1 Mbyte” according to ESP8266EX datasheet.
The SPI flash used in ESP8266 modules is W25qxx from Winbond, and in order to upgrade your flash memory you need to remove the old chip soldered to your module PCB and then solder the new one W25Q32 (32M-bit / 4M-byte), which can be ordered from Aliexpress.
[Code and Solder] channel over Youtube shared with us how to do the upgrade process.