Body size is a major component of fitness. However, the relative contributions of different factors to optimal size, and the determinants of spatial and temporal variation in size, have not been fully established empirically. Here, we use a mesocosm of a Drosophilidae assemblage inhabiting decaying nectarines to investigate the influence of spatial variation in temperature on adult body size in Drosophila simulans Sturtevant. Two treatments were established; one in the sun where developing larvae were exposed to high temperatures and the other in the shade where temperature conditions were milder. The simple developmental effects of temperature differences (i.e. larger flies are likely to emerge from cooler environments), or the simple effects of stressful temperatures (i.e. high temperatures yield wing abnormalities and smaller flies), were overridden by interactive effects between temperature and larval density. Emergences were lower in the sun than shade, probably as a result of temperature-induced mortality. However, flies attained the same final sizes in the shade and sun. In addition, abnormally winged flies were clustered in the shaded treatments. In the shade treatments, where emergences were higher than in the sun, stressful conditions as a result of high larval density likely resulted in wing abnormalities and small size. Consequently, there was little spatial variation in size across the mesocosm, but substantial spatial variation in abundance. Under natural conditions both mortality and non-lethal effects of temperature and/or crowding are likely to play a role in the evolution of body size.