This article reports on a search for dark matter pair production in association with bottom or top quarks in 20.3fb−1 of pp collisions collected at s=8 TeV by the ATLAS detector at the LHC. Events with large missing transverse momentum are selected when produced in association with high-momentum jets of which one or more are identified as jets containing b-quarks. Final states with top quarks are selected by requiring a high jet multiplicity and in some cases a single lepton. The data are found to be consistent with the Standard Model expectations and limits are set on the mass scale of effective field theories that describe scalar and tensor interactions between dark matter and Standard Model particles. Limits on the dark-matter--nucleon cross-section for spin-independent and spin-dependent interactions are also provided. These limits are particularly strong for low-mass dark matter. Using a simplified model, constraints are set on the mass of dark matter and of a coloured mediator suitable to explain a possible signal of annihilating dark matter