Code: Select all
Ogre::Root* root = new Ogre::Root();
Ogre::D3D9Plugin* d3d9plugin = new Ogre::D3D9Plugin();
root->installPlugin(d3d9plugin);
Ogre::RenderSystem* rsys = root->getRenderSystemByName("Direct3D9 Rendering Subsystem");
root->setRenderSystem(rsys);
root->initialise(false);
Ogre::NameValuePairList windowOptions;
windowOptions["show"] = "false";
root->createRenderWindow(
"TestWindow",
640,
480,
false,
&windowOptions);
std::cout << "TextureTest" << std::endl;
for (int i = 0; i < 100000; i++)
{
Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton().create("testText", "General");
Ogre::TextureManager::getSingleton().remove("testText");
}
std::cout << "MaterialTest" << std::endl;
for (int i = 0; i < 100000; i++)
{
Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().create("testMat", "General");
Ogre::MaterialManager::getSingleton().remove("testMat");
}
std::cout << "End of Test" << std::endl;
delete root;
During "TextureTest", the Memory Footprint doesn't change significantly.
During "MaterialTest", the Memory Footprint increases up to ~75MB, and would continue to do so indefinitely if the loop wouldn't stop after 100k iterations. This is only released after deleting Ogre::Root.
I reproduced this behavior under Ogre 1.8.1, as well as the current up-to-date revision of Ogre 1.9 in the repository:
Any reason why this is happening, a bug or wrong usage of Ogre on my side?Changeset: 4790 (a01cca8e4f96) Bugfix commit 9fb67da (https://bitbucket.org/sinbad/ogre/commi ... daf1a24047
Branch: v1-9
User: Transporter
Date: 2013-05-29 00:47:05 +0200 (16 hours)
Parent: 4788 (fba4e499e38e) [GLES2] Add a runtime extension check to prevent calls to null GL function point
Tags: tip