Species undergoing ontogenetic diet shifts face a risk of resource competition that delays transitions between feeding stages. Such ontogenetic bottlenecks are common in piscivorous fish because competition with future prey may retard growth and prevent a size advantage. In pikeperch (Stizostedion lucioperca), year class strength of 0+ cohorts is highly variable and positively related to early onset of piscivory. To identify the causes of this pattern, we experimentally quantified size-dependent planktivorous and piscivorous foraging capacity and incorporated the data into a growth model. For any given prey type and size, foraging capacity described a hump-shaped relationship with predator size. Foraging capacity on daphnids peaked at a pikeperch length of 66 mm, suggesting a narrow scope of planktivory. The highest capacity in the piscivorous niche was reached at a predator-to-prey length ratio of 5, where the ratio was an integrated measure of predator size over several prey sizes. With the growth model, we derived size distributions of 0+ cohorts as functions of resource levels. Simulations revealed two major determinants for the year class strength of pikeperch. First, discontinuous availability of prey sizes counteracted switching to piscivory within the first growing season. This was accentuated by prey fish growth, which caused the planktivory and piscivory niches to separate over time and limited the time window when diet shift was possible. Second, the hump-shaped relationship between size and foraging capacity resulted in growth reduction when growing out of the planktivorous niche. Switching to piscivory in our model occurred along a perpendicular relationship between fish prey and zooplankton density. Zooplankton density determined whether pikeperch reached a size advantage over prey, and fish prey density affected whether the foraging return of piscivory was higher than planktivory. Individuals not reaching a size advantage over prey and failing to become piscivorous were stunted at a size when consumption balanced metabolic requirements. Piscivorous individuals, however, continued to grow fast throughout the season by feeding on the wave of the prey cohort. Our results highlight the importance for predators that shift diet to be synchronized with fluctuations in resource availability, such as the pulses of new cohorts of prey fish.