The doping characteristics of direct-gap bulk n-Al//xGa//1// minus //xAs doped with Si and grown by molecular-beam epitaxy are determined by the coexistence of shallow and deep donors, both of which are caused by Si-impurities. The deep donor is ionized thermally at high temperatures and optically at low temperatures, resulting in an increase of the free carrier concentration. The persistent photoconductivity in selectively n-doped n-AlxGa//1// minus //xGa//1// minus //xAs/GaAs heterostructures is predominantly caused by the photoionization of the deep Si-donor in the Al//xGa//1// minus //xAs layer. Electron-hole generation in the GaAs contributes only a minor part to persistent photoconductivity in n-type heterostructures. In p-type heterostructures, however, electron-hole generation is the dominant mechanism responsible for persistent photoconductivity and contributes 5 multiplied by 10**1**0 holes per cm**2 for a 1 mu m thick GaAs buffer layer to the two-dimensional electron- (hole-) gas. The hole concentration in selectively p-type heterostructures is calculated versus (i) Al-mole fraction, (ii) acceptor concentration in the p-Al//xGa//1// minus //xAs, and (iii) Al//xGa//1// minus //xAs spacer width.