I think that to upgrade (migrate) a HPE FlexNetwork 10500 Switch Series's Comware 5 based OS to a Comware 7 based OS you first have to ensure that your actual Switch hardware (MPU in particular) meets minimum Hardware requirements to let the migration be possible and to then happen succesfully (consider that SDRAM and Flash Memory are related to each specific MPU, right?).
Minimum Hardware requirements are declared on Comware 5 and 7 Release Notes for your HPE FlexNetwork 10500 Switch Series model.
AFAIK, the MPU (JC614A) used on a HPE FlexNetwork 10500 Switch Series running Comware 5 OS is different with respect to the MPU (JG496A) used on a HPE FlexNetwork 10500 Switch Series running Comware 7 OS: read about it here (As example, the MPU supporting Comware 7 OS provides 4 GB of SDRAM, check with display version command what is the amount of SDRAM your actual MPU is providing).
More clearly: considering an HPE FlexNetwork 10500 Switch Series...the Comware 7 OS (with a version number in the format Release 2xxx) applies only to LSU1SUPB0 (JG496A) MPUs, the LSU1SUPA0 (JC614A/JG375A) MPUs cannot run Comware 7 OS software. Reference: here.
So, as you see, it isn't (only[*]) a problem of tiny MPU's Flash Memory size (not forgetting that Comware 7 Boot and System bin files require, separately, about 28 MBytes and 193 MBytes...while the ipe file requires about 220 MBytes)...on the contrary the Flash Memory size is the least of your worries if your MPU is an LSU1SUPA0.
[*] since a storage space could also be a Compact Flash or an external USB Flash Memory (The switch starts up from the default storage medium. The default storage medium can be the Built-In Flash Memory, a Compact Flash Card or a USB disk).
Not completely unrelated (12500 isn't exactly a 10500)...there is a Comware 5 to 7 migration guide for HPE FlexNetwork 12500 Switch Series that can be of help to quantify things to check before considering a Comware 5 to 7 migration (here).
Hope that help.