This sentence uses the idiom "give up the ghost" to mean "to give up, surrender, or cease to function."