In cocos2d-x, I cache the animation in CCAnimationCache. But how can I clear all the animation-cache?
You should try
CCAnimationCache::sharedAnimationCache()->purgeSharedAnimationCache();
It releases all the CCAnimation objects and the shared instance. Else you can also use
removeAnimationByName("youAnimationName");
this will remove particular animation you wish.
Hope this helps you.. :)