Give up the ghost
To die, or in the case of inanimate objects, to cease working.
There are many uses of this phrase in the Bible, including this, from Miles Coverdale's Version, 1535, Acts 12:23:
Immediatly the angell of the LORDE smote him, because he gaue not God the honoure: And he was eaten vp of wormes, and gaue vp the goost.
The metaphorical use of the phrase, that is, in relation to something not living and not able to become a ghost, is 19th century; for example, James Kirke Paulding's, Westward Ho!, 1832, includes:
"At length it gave up the ghost, and, like an over-cultivated intellect, became incurably barren."