Two fundamental questions dealing with simultaneous hermaphrodites are how resources are optimally allocated to the male and female function and what conditions determine shifts in optimal sex allocation with age or size. In this study, I explored multiple factors that theoretically affect fitness gain curves (that depict the relationship between sex-specific investment and fitness gains) to predict and test the overall and size-dependent sex allocation in a simultaneously hermaphroditic brooding shrimp with an early male phase. In Lysmata wurdemanni, sperm competition is absent as hermaphrodites reproducing in the female role invariably mated only once with a single other shrimp. Shrimps acting as females preferred small over large shrimps as male mating partners, male mating ability was greater for small compared to large hermaphrodites, and adolescent males were predominant in the population during the breeding season. In addition, brooding constraints were not severe and varied linearly with body size whereas the ability to acquire resources increased markedly with body size. Using sex allocation theory as a framework, the findings above permitted to infer the shape of the male and female fitness gain curves for the hermaphrodites. The absence of sperm competition and the almost unconstrained brooding capacity imply that both curves saturate, however the male curve levels off much more quickly than the female curve with increasing level of investment. In turn, the predominance of adolescent males in the population implies that the absolute gain of the female curve is greater than that of the male curve. Last, the size-dependent female preference and male mating ability of hermaphrodites determines that the absolute gain of the male curve is greater for small than for large hermaphrodites. Taking into consideration the inferred shape of the fitness gain curves, two predictions with respect to the optimal sex allocation were formulated. First, overall sex allocation should be female biased; it permits hermaphrodites to profit from the female function that provides a greater fitness return than the male function. Second, sex allocation should be size-dependent with smaller hermaphrodites allocating more than proportionally resources to male reproduction than larger ones. This size-dependent sex allocation permits hermaphrodites to profit from male mating opportunities that are the greatest at small body sizes. Size-dependent sex allocation is also expected because the male fitness gain curve decelerates more quickly than the female gain curve and experiments indicated that resources are greater for large than small hermaphrodites. These two predictions were tested when determining the sex allocation of hermaphrodites by dissecting their gonad and quantifying ovaries versus testes mass. Supporting the predictions above, hermaphrodites allocated, on average, 118 times more to the female than to the male gonad and the proportion of resources devoted to male function was higher in small than in large hermaphrodites. A trade-off between male and female allocation is assumed by theory but no negative correlation between male and female reproductive investment was observed. In L. wurdemanni, the relationship between sex-specific investment and fitness changes during ontogeny in a way that is consistent with an adjustment of sex allocation to improve size-specific reproductive success.