Minimum free energy in heat conduction: materials with memory