Two charged balls of mass m having charge q are connected by an undeformed spring of length l and released. After some time, the vibrations of the balls due to friction in the spring stopped and the balls were at a distance of 2l from each other. Determine the amount of heat that is released in the spring.