My mom's cat had the same problem once, and the vet gave her some hairball stuff which was mentioned previously. He is a ragdoll with very long fur and the vet didn't know if that had anything to do with it or not because he, surprisingly, doesn't really get hairballs. But it helped when he was constipated, so I thought I would just reconfirm everyone else's suggestions on that.