OgreXMLConverter memory leaks

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
Pulas
Halfling
Posts: 61
Joined: Sat Oct 29, 2011 9:39 am

OgreXMLConverter memory leaks

Post by Pulas » Fri Jan 04, 2013 7:36 am

It seems that the tool OgreXMLConverter has memory leaks.
I converted a mesh file to a xml file with memory track, whick detected memory leaks as below:

Code: Select all

Ogre Memory: Detected memory leaks !!! 
Ogre Memory: (51) Allocation(s) with total 4272 bytes.
Ogre Memory: Dumping allocations -> 
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreSubMesh.cpp(49) : {28 bytes} function: Ogre::SubMesh::SubMesh
(unknown source):(0) : {48 bytes} function: 
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreMeshSerializerImpl.cpp(1000) : {68 bytes} function: Ogre::MeshSerializerImpl::readSubMesh
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreSubMesh.cpp(49) : {28 bytes} function: Ogre::SubMesh::SubMesh
e:\ogre\sources\ogre_src_v1-8-1\ogremain\include\OgreSharedPtr.h(84) : {4 bytes} function: Ogre::SharedPtr<class Ogre::HardwareIndexBuffer>::SharedPtr
e:\ogre\sources\ogre_src_v1-8-1\ogremain\include\OgreSharedPtr.h(84) : {4 bytes} function: Ogre::SharedPtr<class Ogre::HardwareIndexBuffer>::SharedPtr
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreDefaultHardwareBufferManager.cpp(97) : {12 bytes} function: Ogre::DefaultHardwareIndexBuffer::DefaultHardwareIndexBuffer
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreDefaultHardwareBufferManager.cpp(166) : {56 bytes} function: Ogre::DefaultHardwareBufferManagerBase::createIndexBuffer
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreMeshSerializerImpl.cpp(1000) : {68 bytes} function: Ogre::MeshSerializerImpl::readSubMesh
(unknown source):(0) : {48 bytes} function: 
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreMesh.cpp(143) : {184 bytes} function: Ogre::Mesh::createSubMesh
(unknown source):(0) : {80 bytes} function: 
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreDefaultHardwareBufferManager.cpp(166) : {56 bytes} function: Ogre::DefaultHardwareBufferManagerBase::createIndexBuffer
(unknown source):(0) : {48 bytes} function: 
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreTechnique.cpp(469) : {464 bytes} function: Ogre::Technique::operator =
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreDefaultHardwareBufferManager.cpp(97) : {12 bytes} function: Ogre::DefaultHardwareIndexBuffer::DefaultHardwareIndexBuffer
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreDefaultHardwareBufferManager.cpp(166) : {56 bytes} function: Ogre::DefaultHardwareBufferManagerBase::createIndexBuffer
(unknown source):(0) : {48 bytes} function: 
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreMesh.cpp(143) : {184 bytes} function: Ogre::Mesh::createSubMesh
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreMeshSerializerImpl.cpp(1000) : {68 bytes} function: Ogre::MeshSerializerImpl::readSubMesh
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreTechnique.cpp(342) : {464 bytes} function: Ogre::Technique::createPass
(unknown source):(0) : {48 bytes} function: 
e:\ogre\sources\ogre_src_v1-8-1\ogremain\include\OgreSharedPtr.h(84) : {4 bytes} function: Ogre::SharedPtr<class Ogre::HardwareIndexBuffer>::SharedPtr
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreSubMesh.cpp(49) : {28 bytes} function: Ogre::SubMesh::SubMesh
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreMeshSerializerImpl.cpp(1000) : {68 bytes} function: Ogre::MeshSerializerImpl::readSubMesh
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreMesh.cpp(143) : {184 bytes} function: Ogre::Mesh::createSubMesh
(unknown source):(0) : {48 bytes} function: 
e:\ogre\sources\ogre_src_v1-8-1\ogremain\include\OgreSharedPtr.h(84) : {4 bytes} function: Ogre::SharedPtr<class Ogre::HardwareIndexBuffer>::SharedPtr
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreSubMesh.cpp(49) : {28 bytes} function: Ogre::SubMesh::SubMesh
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreSubMesh.cpp(49) : {28 bytes} function: Ogre::SubMesh::SubMesh
(unknown source):(0) : {80 bytes} function: 
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreMesh.cpp(143) : {184 bytes} function: Ogre::Mesh::createSubMesh
(unknown source):(0) : {80 bytes} function: 
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreTechnique.cpp(469) : {464 bytes} function: Ogre::Technique::operator =
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreMeshSerializerImpl.cpp(1000) : {68 bytes} function: Ogre::MeshSerializerImpl::readSubMesh
e:\ogre\sources\ogre_src_v1-8-1\ogremain\include\OgreSharedPtr.h(84) : {4 bytes} function: Ogre::SharedPtr<class Ogre::HardwareIndexBuffer>::SharedPtr
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreDefaultHardwareBufferManager.cpp(97) : {12 bytes} function: Ogre::DefaultHardwareIndexBuffer::DefaultHardwareIndexBuffer
(unknown source):(0) : {80 bytes} function: 
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreDefaultHardwareBufferManager.cpp(166) : {56 bytes} function: Ogre::DefaultHardwareBufferManagerBase::createIndexBuffer
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreSubMesh.cpp(49) : {28 bytes} function: Ogre::SubMesh::SubMesh
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreMesh.cpp(143) : {184 bytes} function: Ogre::Mesh::createSubMesh
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreDefaultHardwareBufferManager.cpp(166) : {56 bytes} function: Ogre::DefaultHardwareBufferManagerBase::createIndexBuffer
(unknown source):(0) : {80 bytes} function: 
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreDefaultHardwareBufferManager.cpp(97) : {12 bytes} function: Ogre::DefaultHardwareIndexBuffer::DefaultHardwareIndexBuffer
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreDefaultHardwareBufferManager.cpp(166) : {56 bytes} function: Ogre::DefaultHardwareBufferManagerBase::createIndexBuffer
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreDefaultHardwareBufferManager.cpp(97) : {12 bytes} function: Ogre::DefaultHardwareIndexBuffer::DefaultHardwareIndexBuffer
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreMeshSerializerImpl.cpp(1000) : {68 bytes} function: Ogre::MeshSerializerImpl::readSubMesh
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreMesh.cpp(143) : {184 bytes} function: Ogre::Mesh::createSubMesh
e:\ogre\sources\ogre_src_v1-8-1\ogremain\include\OgreSharedPtr.h(84) : {4 bytes} function: Ogre::SharedPtr<class Ogre::HardwareIndexBuffer>::SharedPtr
..\..\..\Sources\ogre_src_v1-8-1\OgreMain\src\OgreDefaultHardwareBufferManager.cpp(97) : {12 bytes} function: Ogre::DefaultHardwareIndexBuffer::DefaultHardwareIndexBuffer
(unknown source):(0) : {80 bytes} function: 

After I added the following code, the OgreTechnique momory leak has gone.

Code: Select all

    Ogre::Pass::processPendingPassUpdates(); // make sure passes are cleaned
As for mesh, it seems that MeshManager does't delete all meshes they created.
When I add following code, the momory leaks still exist.

Code: Select all

m_pResourceGroupManager->shutdownAll();

After some debugging, I found the load state of mesh resource is wrong.

Code: Select all

    MeshPtr mesh = MeshManager::getSingleton().create("conversion", 
        ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    meshSerializer->importMesh(stream, mesh.getPointer());
the load state of mesh is LOADSTATE_UNLOADED.

Is this a bug?
0 x

User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4293
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 2
Contact:

Re: OgreXMLConverter memory leaks

Post by spacegaier » Fri Jan 04, 2013 12:20 pm

Pulas wrote:Is this a bug?
If there is a memory leak (and it seems there is although I did not investigate it myself so far), it counts definitely as a bug. So please create a ticket on JIRA for it. Thanks.
0 x
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...

Post Reply