Compensation processes in magnesium doped GaN epilayers and bulk samples are studied. We demonstrate enhancement of potential fluctuations in Mg doped samples, from Kelvin probe atomic force microscopy measurements. Large- and small-scale light emission fluctuations are also demonstrated. Micro-photoluminescence (PL) study indicates an unusual anti-correlation between the intensities of excitonic and defect-related emission processes in p-type doped structures and also the presence of the so-called hot-PL. Hot-PL observed in compensated p-type samples, we relate to the presence of strong potential fluctuations. (C) 2004 WILEY-VCH Verlag GmbH & Co. KGaA, Weinheim.