This question already has an answer here:

The Death Star is spherical, and as big as a moon.

It has a gravity generator, but how does it work ?

Which one of the case below (Fig.1 or Fig.2) is the correct one ?

enter image description here

marked as duplicate by Gallifreyan, Valorum star-wars Jan 9 '17 at 10:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.