ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > irrXML
forum topic indicator Memory leaks in irrXML
person icon
ebyard
Registered User
Quote
2011-10-21 15:02:11

Hi,

My program makes extensive use of irrXML, and whilst it's great, I get this problem multiple times (from Visual Leak Detector):

f:\dd\vctools\crt_bld\self_x86\crt\src\mlock.c (278): PR1030.exe!_mtinitlocknum + 0x13 bytes
f:\dd\vctools\crt_bld\self_x86\crt\src\stream.c (71): PR1030.exe!_getstream + 0xC bytes
f:\dd\vctools\crt_bld\self_x86\crt\src\fopen.c (61): PR1030.exe!_fsopen + 0x5 bytes
f:\dd\vctools\crt_bld\self_x86\crt\src\fopen.c (125): PR1030.exe!fopen + 0xF bytes
c:\projects\edge\xml\irrxml.cpp (29): PR1030.exe!irr::io::CFileReadCallBack::CFileReadCallBack + 0xE bytes
c:\projects\edge\xml\irrxml.cpp (89): PR1030.exe!irr::io::createIrrXMLReader + 0x4C bytes

PR1030.exe is my application :)

All instances of the code do this:

	// Load XML file
IrrXMLReader* xml;
xml = NULL;
xml = createIrrXMLReader("config.xml");
// extract some data
extractData();
// Close the file and free the memory
delete xml;


...and I get this leak as detailed above. Can anyone help?

Thanks

person icon
niko
Moderator
Quote
2011-10-22 07:10:50

Hm, I guess this is an error by the leak detector. Do a breakpoint where the file is closed, it should hit this location.

person icon
ebyard
Registered User
Quote
2011-10-28 17:21:50

Yes it hits the breakpoint where the file is closed, but is there any other memory used by irrXML which is not deallocated properly?

person icon
ebyard
Registered User
Quote
2012-01-20 13:21:56

I guess that's a no, then? I need to get this cleaned up, as it's causing a project to over-run.

This post is interesting: http://irrlicht.sourceforge.net/forum/viewtopic.php?t=32184

In our program we read an XML file on a certain event, and after approx 160000 times (yes it's possible in real use) the system reports out of memory.

emoji icon_sad

person icon
ebyard
Registered User
Quote
2012-01-20 13:47:06

I've just compared the irrXML.cpp and irrXML.h in the IrrLicht engine to the one in the download (old v1.2) and it looks like there are many bug fixes.

Can you please update the version for download, and/or tell me what I need to in order to update v1.2? I see a lot of function definitions have changed.

For example, "IRRLICHT_API" is used a lot, and this doesn't exist in v1.2

Thanks

person icon
niko
Moderator
Quote
2012-02-02 19:22:22

Hi,
difficult to say where the memory leak happens for you, it should be easier to find it out with your sources and a debugger.
But usually, irrXML doesn't have any memory leaks, also in that version available here. A lot has changed in the irrlicht embedded irrxml version, but there's not much which is really useful for people using irrxml as it is intended to be, so it probably won't be updated like that in the near future. The IRRLICHT_API is just a macro used for dll exports, and removed in the standalone version of irrxml, since it doesn't make any sense there.

person icon
ebyard
Registered User
Quote
2012-02-03 12:05:42

Hi Niko

Thanks for the reply.

We see in the debugger a lot of reported memory leaks, exactly as reported in this thread http://irrlicht.sourceforge.net/forum/viewtopic.php?t=32184

We use irrXML extensively in our project, and I have to clean up all these errors, or I have to use another XML parser :(


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |