In this paper we study the relationship between three compactications of the moduli space of gauge equivalence classes of Hermitian-Yang-Mills connections on a xed Hermitian vector bundle over a projective algebraic manifold of arbitrary dimension. Via the Donaldson-Uhlenbeck-Yau theorem, this space is analytically isomorphic to the moduli space of stable holomorphic vector bundles, and as such it admits an algebraic compactication by Gieseker-Maruyama semistable torsion free sheaves. A recent construction due to the rst and third authors gives another compactication as a moduli space of slope semistable sheaves. In the present article, following fundamental work of Tian generalising the analysis of Uhlenbeck and Donaldson in complex dimension two, we dene a gauge theoretic compactication by adding certain gauge equivalence classes of ideal connections at the boundary. Extending work of Jun Li in the case of bundles on algebraic surfaces, we exhibit comparison maps from the sheaf theoretic compactications and prove their continuity. The continuity, together with a delicate analysis of the bres of the map from the moduli space of slope semistable sheaves allows us to endow the gauge theoretic compactication with the structure of a complex analytic space.