zhucde
11-05-2010 08:02:11
i found two memory problems,
Problem1. PG object can no be delete completely.
see Example8:
if you unload all PG then reload it , you will find the Memory increased then first load,
if you do it time and again, the memory will increase more and more.
so how to delete pg completely ?
Problem2:
when go through the PG scene(the more pg objects , the more obvious), the memory increase slowly,
i test a scene, with 20 pg objects,
when start , the memory is 600M, and then play a camera animation with loop,
in fourth round, the memory increased by 100M,
and the FPS Reduce doubled,
it is terrible ,
what's wrong with it ?
Problem1. PG object can no be delete completely.
see Example8:
void World::unload()
{
//[NOTE] Always remember to delete any PageLoader(s) and PagedGeometry instances to avoid memory leaks.
//Delete the PageLoader's
delete grass->getPageLoader();
delete trees->getPageLoader();
delete bushes->getPageLoader();
//Delete the PagedGeometry instances
delete grass;
delete trees;
delete bushes;
//Also delete the entities
sceneMgr->destroyEntity("Tree1");
sceneMgr->destroyEntity("Fern");
sceneMgr->destroyEntity("Plant");
sceneMgr->destroyEntity("Mushroom");
}
if you unload all PG then reload it , you will find the Memory increased then first load,
if you do it time and again, the memory will increase more and more.
so how to delete pg completely ?
Problem2:
when go through the PG scene(the more pg objects , the more obvious), the memory increase slowly,
i test a scene, with 20 pg objects,
when start , the memory is 600M, and then play a camera animation with loop,
in fourth round, the memory increased by 100M,
and the FPS Reduce doubled,
it is terrible ,
what's wrong with it ?