Mating elicits a dramatic changes in physiology, behavior, and life-history traits in insects, but little is known about the relationship between mating and the capacity of insects to resist environmental stressors. Starvation is one of the most ubiquitous forms of environmental stress faced by all insects under natural conditions. Previous studies using Drosophila melanogaster flies has shown that mated females lived longer under starvation than did virgin females, but the mechanistic basis for such post-mating increase in starvation resistance remains largely unexplored. The objective of this study was to investigate the behavioral and physiological mechanisms of mating-induced alteration in starvation resistance and its heritable genetic variations in D. melanogaster. In the first experiment (Experiment 1), we compared starvation resistance (measured as starving time before death), body compositions, and food intake between mated and unmated flies of both sexes using a large outbred population. In the second experiment (Experiment 2), starvation resistance and body composition were quantified for mated male and female flies derived from each of 19 highly inbred genetic lines. Results from Experiment 1 showed that mated females were better able to resist starvation than virgin females and males because they ate more and thus laid down more fats in their body. Results from Experiment 2 revealed a significant heritable genetic variation in starvation resistance and its correlated body composition parameters for both sexes. Overall, females had a higher starvation resistance than males, but the magnitude of such intersexual difference varied among genetic lines, as suggested by a significant sex-by-line interaction. Cross-sex genetic correlations were highly significant and positive for starvation resistance, indicating that the genetic factors controlling the starvation resistance in D. melanogaster are shared between the two sexes.