on one's last legs
Extremely tired, close to collapsing, as in We've been cleaning house all day and I'm on my last legs. This hyperbolic expression originally meant "close to dying," and in John Ray's 1678 proverb collection it was transferred to being bankrupt. Soon afterward it was applied to the end of one's resources, physical or otherwise. It is sometimes applied to things, as in That furnace is on its last legs.