Author Topic: TextMesh memory leak  (Read 6750 times)

markofevil3

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
TextMesh memory leak
« on: January 22, 2014, 04:30:04 AM »
When destroy or hide UILabel, textmesh does not destroy
Profile when start NGUI


Profile after create some UI


Profile after delete all UI

markofevil3

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: TextMesh memory leak
« Reply #1 on: January 22, 2014, 04:33:08 AM »
Note: im using unity 4.3.0, NGUI 3.0.9f3

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TextMesh memory leak
« Reply #2 on: January 22, 2014, 05:04:25 AM »
TextMesh is a Unity class and has nothing to do with NGUI.

markofevil3

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: TextMesh memory leak
« Reply #3 on: January 22, 2014, 05:59:37 AM »
the HD_UI(NGUI atlas) and font material are also leaked. after deleted all UI, they does not reduce too.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TextMesh memory leak
« Reply #4 on: January 22, 2014, 06:06:30 AM »
Of course the atlas will stay. Atlas is a prefab. Once you use it, it will be in memory unless you call UnloadUnusedAssets(). Even so I'm not sure if it will work unless you actually load it first using Resources.Load.

I suggest you consult Unity's documentation on how and when it unloads assets.

https://docs.unity3d.com/Documentation/ScriptReference/Resources.UnloadUnusedAssets.html