I haven't had any problems with animals despawning, but I've had problems with breeding. I've even tried multiple servers, and slaughtered animals just to see if I'm maxed out on animals.
Animals shouldn't despawn if they can't move more than 20 blocks. I haven't noticed any problems with this but could you tell me how your animal pens are set up?
thanks
How big is it? 15x15? 20x40?