What were you doing on wifi? Occasionally this has happened to me. Mostly when either the wifi connection is weak or intermittent, the iphone processor needs to work harder to keep or find the signal. I think of this almost like when your web browser is slow or hangs on your desktop. It could also be if you are loading very memory intensive pages. Although 5 minutes doesnt seem very long.
How is the iPhone running otherwise? Do you have a lot of lag? Were you also listening to music at the same time?
If I've helped you, you can help me by clicking on that Thanks button.
iPhone, the Swiss Army knife of the 21st Century.
i use wifi to connecting to the internet, cydia mostly, downloading something, wifi signal was good, my iphone connecting peer to peer to my notebook to used my internet connection. i dont have wifi hotspot.
i try in public hotspot that happen too.
beside that my iphone running well, i did't listen to music while downloading.
was it warm, or burning hot like it was gonna melt or start a fire. just warm is normal. you will feel it warm while charging too. if it felt like it was on fire, then you got issues.