The video posted by H7K is an M4A1 with a heavy barrel:
M-4A1 Firing Test - Video Library - The New York Times
Data from the test:
Barrel Smolders and Glows: 1:48
Guard Assembly Catches Fire: 2:22
Fails to Fire Automatic: 4:47
Shots Fired: 911
Here is a video of a standard M4, with a lighter/thinner barrel then the M4A1:
M-4 Firing Test - Video Library - The New York Times
Data from test:
Barrel Droops: 1:20
Barrel Ruptures: 1:51
Shots Fired: 535
A significant difference.
These tests were performed by Colt, after the Battle of Wanat, on a request by the US Army. During the battle, 9 US servicemembers were killed, many more wounded. In the aftermath, there was a lot of speculation and fingerpointing in regards to the reliability of the M4 platform, as many soldiers reported that their weapons malfunctioned. Some SAW's started to malfunction after a while as well. It turned out that the issue was not the reliability of the system, the guns worked fine....UNTIL the rate of fire exceeded tolerances, and the barrels overheated causing the failures you see in the videos above. Of course, the rate of fire in the videos is unrealistic in a combat situation, but if you factor in the temperature in that area in June, you get an extra heating factor.
An article covering this:
What Really Happened at Wanat | U.S. Naval Institute
Here is a test done to show temperature differences in a DI and piston system:
Piston v. DI temp measurements - M4Carbine.net Forums
There is not a significant difference. As you can see, the bolt and bolt carrier in both systems stay pretty cool. What really heats up is the flash hider, barrel and gas block.