I donated a bunch of books to the library, as well, but that was problematic...I don't have a car, so hauling boxes worth of books to the library on my bike one backpack full at a time was time-consuming.
If I'd thought to donate them immediately after reading them (as though I were simply returning checked out books), it would have worked better. But I never trained myself to think that way about books I bought. But, the library here in Mountain View is extremely good; it was very rare that I wanted a book that they didn't have, though sometimes I had to wait a week or two for a copy to show up.
Postage can get rather hefty for some of those books. (Though I admit I did this with some of my textbooks in college...I'd register for the course, buy the textbook, read the whole textbook in the first week, return the textbook for a full refund, and then drop the course and take something else.)