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.
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).
Why does everyone assume the basilisk was trapped in the chamber? The way you get in and out of the chamber is by speaking parseltongue. Snake or not, the basilisk speaks parseltongue.
It's entirely possible that it has been going out into the forest and eating things it finds there the entire time, and only goes after humans when specifically directed to do so. It would make sense for it's original instructions to have been something along those lines when Slytherin was actually alive.
It also makes more sense of the bones - remember that the bones and the skin were between the bathroom pipe entrance and the doors, which needed a password. Slytherin's face also needed a password to open. So the basilisk had to pass those two obstacles before it could leave the skin and bones there.
Also, I realize that the story is all about Slytherin's heir releasing the monster from the chamber, but first - even in the book's world that's definitely a legend. Even the fact that the monster was a basilisk had been forgotten or had never been part of the legend at all. It needing to be released from the chamber might have been an addition to the story, or it might only apply when you are directing it to attack someone, etc. Who can tell for sure with a story that old.