Origin of Genies

Are genies immortal?

Genies are often presented as immortal supernatural beings that grant wishes made by humans. Their immense powers are only unleashed after they’re freed from an oil lamp or bottle. As soon as they wake, they comment on how long they’ve been sealed away and how glad they are to be free.

This brings up unusual questions: are genies immortal? Can they actually live forever trapped in a lamp? Can they live forever when they roam the world freely?