thermal stress in single crystal thin films on a rigid substrate are used to study size effects. The relation between the residual stress and the dislocation structure in the films after cooling is analyzed using dislocation dynamics. A boundary layer characterized by a high stress gradient and a high dislocation density is found close to the impenetrable film-substrate interface. There is a material-dependent threshold film thickness above which the dislocation density together with the boundary layer thickness and stress state are independent of film thickness. In such films the stress outside the boundary layer is on average very low, so that the film-thickness-in dependent boundary layer is responsible for the size effect. A larger size...