Author Topic: Memory leaks from NGUI detected by xcode leaks instruments  (Read 2999 times)

ds_2051

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Memory leaks from NGUI detected by xcode leaks instruments
« on: July 21, 2013, 01:34:56 PM »
Hi,

I have created a demo scene in Unity with simple classes UIPanel,UIAnchor,UIWidget etc.Having following structure

Root
---Camera
-------Anchor
----------Panel
-------------Widgets

But when i built the game in xcode and ran leaks instruments on it.The tests were showing memory leaks happening from almost all the above mentioned classes mentioned in leaktrace,with responsible frame as g_malloc().

Can you please suggest why these leaks are getting shown by xcode instruments.Totally stuck with it right now :'( :-\

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Memory leaks from NGUI detected by xcode leaks instruments
« Reply #1 on: July 22, 2013, 04:47:28 AM »
There is no such thing as a memory leak in C#. All memory is garbage-collected. What are you trying to do? You need to use the profiler that comes with Unity, not XCode.

ds_2051

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Memory leaks from NGUI detected by xcode leaks instruments
« Reply #2 on: July 22, 2013, 05:08:38 AM »
Even in the Unity profiler under HideFlags.DontSave Assests ,NGUI fonts and texture atlases are coming with Reason(Object is Marked Don't Save.Remove them explicitly or they will leak).Is it serious b'coz from what i understood it's applicable only if scene changes in the game? :(

But to check the leaks i build the application with a single scene and ran it on phone.Then performed xcode leaks instrument test.The tests leak-traceback shows leakage happening with last class being UIPanel,UIAnchor  and then entering into native API calls.

Thus i am not able to understand why xcode is showing leakage from NGUI classes applied on my assests in Game.Am i missing something in my project?
Any help on understanding the reason will be highly appreciated  :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Memory leaks from NGUI detected by xcode leaks instruments
« Reply #3 on: July 22, 2013, 01:11:11 PM »
UIAnchor doesn't do anything with HideFlags. Panel does, but it cleans up everything properly. NGUI has been out for a long time and got quite polished by now. If there were such major issues like memory leaks, they would have been discovered and fixed well over a year ago.