Abstract Barnacles, marine crustaceans, have three sexual patterns: simultaneous hermaphroditism, dioecy and androdioecy. In dioecy and androdioecy, large individuals (females and hermaphrodites, respectively) are attached by dwarf males. Depending on species, some dwarf males grow up, others do not in their life time. To investigate which environmental conditions affect growth patterns of dwarf males of barnacles, we investigate the evolutionarily stable life history strategy of dwarf males using Pontryagin's maximum principle. Sperm competition among dwarf males and that among dwarf males and large hermaphrodites is taken into account. Dwarf males grow up in food-rich environments, while they do not grow at all in food-poor environments. ESS of the resource allocation schedule between reproduction and growth follows an “intermediate growth strategy” (simultaneous growth and reproduction) for dioecious species, in which sperm competition is not severe. On the other hand, it approaches “bang-bang control” (switching from allocating all resources toward growth then to reproduction), as sperm competition against surrounding large hermaphrodites becomes severe in androdioecious species.