manager->cur_weight is not initialized, which may cause the cache function to fail.
manager->cur_weight