Immunosenescence, the decline of immune function with age, results in increased risk of infection as an individual ages. The underlying reasons are still poorly understood. Here, we ask whether the rate of decline of an immune indicator is positively correlated with the cost of maintaining it, as predicted by optimal resource allocation theory. Using 30 female ruffs Philomachus pugnax ranging in age from 0.5-12 years we found no effect of age on five indicators of constitutive innate immunity, which is cheap to use and maintain. Body temperature increase following injection with lipopolysaccharide is an indicator of induced innate immunity, which is energetically expensive, and showed a curvilinear relationship with age, with a maximum in middle-aged birds. Our results suggest that changes in immune function with age may depend on the energetic cost of using an immune trait.