We formulate and analyze two dynamic energy budget models, a net assimilation model with constant allocation strategy and a net production model with a 2-stage allocation strategy, with the objective of determining strategies that maximize the expected lifetime reproductive energy. The per capita death rate depends on the organism's size, as for example when the main cause of death is predation. In the analysis of the net production model, the size at maturity is calculated along with the probability of reaching that size. We show that a small probability of survival to maturity is incompatible with the simple assumption of an exponential survival probability. We demonstrate that when the hazard rate is significantly greater for small individuals than large ones, it is possible for the optimum strategy to be for an individual to grow to a large size in spite of an arbitrarily small probability of survival to maturity. Numerical simulations indicate how the optimal allocation strategies depend on the parameter values.