It is discussed how the proximity of a free surface or mobile interface may affect the strain relaxation behavior in a viscoelastic material, such as a polymer melt. The eigenmodes of a viscoelastic film are thus derived, and applied in an attempt to explain the experimentally observed substantial shift of the glass transition temperature of sufficiently thin polymer films with respect to the bulk. Based on the idea that the polymer freezes due to memory effects in the material, and exploiting results from mode-coupling theory, the experimental findings of several independent groups can be accounted for quantitatively, with the elastic modulus at the glass transition temperature as the only fitting parameter. The model is finally applied discussing the possibility of polymer surface melting. A surface molten layer is predicted to exist, with a thickness diverging as the inverse of the reduced temperature. A simple model of thin polymer film freezing emerges which accounts for all features observed experimentally so far.