Thermal phenomena in phase change memory