Detailed theoretical analysis of the longitudinal spatial hole burning in quantum dot (QD) lasers is given. The multimode generation threshold is calculated as a function of the parameters of structure (surface density of QDs, QD size dispersion, and cavity length) and temperature. Unlike conventional semiconductor lasers, thermally excited escapes of carriers away from QDs, rather than diffusion, are shown to control smoothing-out spatially nonuniform population inversion and hence the multimode generation threshold in QD lasers. A decrease in the QD size dispersion is shown to increase considerably the relative multimode generation threshold. The maximum tolerable QD size dispersion and the minimum tolerable cavity length, at which the lasing is possible to attain, are shown to exist. Concurrent with the decrease of threshold current, the reduction of multimode generation threshold is shown to occur with decreased temperature. For the structures optimized to minimize the threshold current density for the main longitudinal mode, the dependences of the multimode generation threshold on the QD size dispersion, cavity length, and temperature are obtained. The ways to optimizing the QD laser structure, aimed at maximizing the multimode generation threshold, are outlined.