If you power your ESP8266 from a pair of AA batteries, they'll provide around 3000 milliamp-hours. So your circuit could last for 3000 hours on such batteries if you can make it use only 1mA by using one of the sleep modes - but it's only enough for 15-50 hours active operation.
If your product has enough space for the equivalent of 80 AA batteries, it could operate in active mode for 600 hours even with the highest power transmission. If you don't want to use that many batteries, you'll need to either use sleep mode or find some other power source (maybe a solar cell, if not the mains?)
Therefor the space for battery is limited, in this case what is the best solution, please kindly let me know.Thanks