Leviathan was held that God originally produced a male and a female leviathan, but lest in multiplying the species should destroy the world, he slew the female, reserving her flesh for the banquet that will be given to the righteous on the advent of the Messiah. Rashi's commentary on repeats the tradition: the...sea monsters: The great fish in the sea, and in the words of the Aggadah (B.B. 74b), this refers to the Leviathan and its mate, for He created them male and female, and He slew the female and salted her away for the righteous in the future, for if
Leviathan they would propagate, the world could not exist because of them. הַתַּנִינִם is written. [I.e., the final “yud,” which denotes the plural, is missing, hence the implication that the Leviathan did not remain two, but that its number was reduced to one.] – [from Gen. Rabbah 7:4, Midrash Chaseroth V’Yetheroth, Batei Midrashoth, vol 2, p. 225]. In the Talmud "Baba Bathra 75a" it is told that the Leviathan will be slain and its flesh served as a feast to the righteous in [the] Time to Come, and its skin used to cover the tent where the banquet will take place.