The disposable soma theory suggests that aging occurs because natural selection favors a strategy in which fewer resources are invested in somatic maintenance than are necessary for indefinite survival. However, laboratory rodents on calorie-restricted diets have extended life spans and retarded aging. One hypothesis is that this is an adaptive response involving a shift of resources during short periods of famine away from reproduction and toward increased somatic maintenance. The potential benefit is that the animal gains an increased chance of survival with a reduced intrinsic rate of senescence, thereby permitting reproductive value to be preserved for when the famine is over. We describe a mathematical life-history model of dynamic resource allocation that tests this idea. Senescence is modeled as a change in state that depends on the resources allocated to maintenance. Individuals are assumed to allocate the available resources to maximize the total number of descendants. The model shows that the evolutionary hypothesis is plausible and identifies two factors, both likely to exist, that favor this conclusion. These factors are that survival of juveniles is reduced during periods of famine and that the organism needs to pay an energetic "overhead" before any litter of offspring can be produced. If neither of these conditions holds, there is no evolutionary advantage to be gained from switching extra resources to maintenance. The model provides a basis to evaluate whether the life-extending effects of calorie-restriction might apply in other species, including humans.