The paper proposes a comparison between a nonlinear optimization tool and genetic algorithms (GAs) for optimal location and sizing of distributed generation (DG) in a distribution network. The objective function comprises of both power losses and investment costs, and the methods are tested on the IEEE 69-bus system. The study covers a comparison between the proposed approaches, the influence of GAs parameters on their performance in the DG allocation problem and the importance of installing the right amount of DG in the best suited location.