The lifespan of a Basilisk might be thousands of years, but how can one survive without eating anything for thousands of years?
The Basilisk is a brilliant green serpent that may reach up to fifty feet in length. The male has a scarlet plume upon its head. It has exceptionally venomous fangs but its most dangerous meansof attack is the gaze of its large yellow eyes. Anyone looking directly into these will suffer instant death.
If the food source is sufficient (the Basilisk will eat all mammals and birds and most reptiles), the serpent may attain a very great age. Herpo the Foul’s Basilisk is believed to have lived for close on nine hundred years.
Fantastic Beasts and Where to Find Them - Newt Scamander - pages 3-4
But the tunnel was quiet as the grave, and the first unexpected sound they heard was a loud crunch as Ron stepped on what turned out to be a rat’s skull. Harry lowered his wand to look at the floor and saw that it was littered with small animal bones.
Chamber of Secrets - page 223 - UK Hardcover - chapter 16, The Chamber of Secrets
Fantastic Beasts and Where to Find Them explains that Basilisks stay alive by eating any and all mammals, birds, and most reptiles. Page 223 of Chamber of Secrets notes the presence of numerous animal remains. I don't interpret this to be incidental; J.K. Rowling noted the animal remains because it was the Basilisk who'd left them there, as opposed to noting casually, "Oh, the outer chamber was nicely decorated in rocks, dirt, slime on the walls, and animal skeletons."
I believe that is your canon answer: The animal remains were left by the Basilisk over the years, as it ate mammals, birds, and some reptiles to survive. That might be a boring answer, but, well, I believe it's the canon explanation.
I'm pretty sure that in the book it states that there are the bones of dead animals all over the place as Harry is entering the chamber.
Snakes can often live for a year between meals, if they get something significant. I would suspect that ( as per @AlisdairCM ), some animals would always find their way into its lair, and it lived off them.
As a magical creature, it can probably survive on less that you might expect. One student a year surely wouldn't be missed ..... ;)
As suggested in my answer to another question, I will post my point of view here.
Remember that the Chamber of Secret (and most importantly the basilisk) was a vengeance device. Slytherin didn't plan any movement mean for the Basilisk because when he left Hogwart, I guess the basilisk was still an egg. He designed this room as a tool for the use of a future heir of his. I strongly think that the basilisk was not put there as a "splinter cell" murderer, but as a war weapon.
Riddle did release the basilisk once, but before that the basilisk was probably in a magic sleep state, thus not needing to move.
So, although it is only supposition, I always believed that the Basilisk was not 1000-year-old but 50-year-old. After all, when Harry enters the Chamber, he sees one dead skin. A 1000-year-old basilisk would have produced a lot more (personnal guess).