Jump to content

Xml Memory Leak


photo

Recommended Posts

Posted

I have created xml like

 

Xml test = new Xml();

 

after that added few child

 

for(int i = 0; i < 100; i++)

{

      test.addChild("test" + i);

}

 

saved the xml using

 

test.save("test");

 

When i run console command world_memory_usage

it say xml has 'x' mb usage

 

after that i deleted xml using delete

 

delete test;

 

after deletion i checked again world_memory_usage

it showed the same 'x' mb usage

 

 

did i forget anything which need to be done before delete xml for clearing memory?

 

Posted

I am NOT 100% sure, but as Unigine internal script garbage collection not always kicks in immediately (e.g. every frame) you shouldn't expect an immedeate drop of allocated pysical memory. Maybe it will be released later or only after exceeding some memory limit.

Posted

Thanks for the quick reply, Ulf. Actually it does not deallocate the memory until the exe is shutdown. In fact this issue is creating a memory leak that's crashing the exe within a few minutes.

Posted

Ok, then Unigine crew should have a look on issue.

Posted

Hi santosh.a,

Thank you for the detailed description! I've made a simple test scene with your code, could you please confirm that Memory, Heap, Allocation counters from profiler are not increasing when you open test_xml world? Please, correct scene if I made a mistake.

 

Actually, memory allocations starting to grow in debug build when world_memory_usage command is being executed (uncomment line 26 in script). I will ask developers if this is actually bug or not.

 

Thanks!

 

xml_test.zip

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Posted

Hi silent,

 

Memory and heap allocation counters increase and after deleting they don't decrease.

 

 

Thanks

Posted

Hi,

 

Could you please provide scene with xml which cause engine crash? I can't reproduce memory leak with only XML code. However, world_memory_usage will cause memory increase, if called every update, because it prints a lot of info directly into the console. To avoid memory growth you can call clear command.

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

×
×
  • Create New...