Author Topic: Too much GC alloc  (Read 2893 times)

PoN

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 111
    • View Profile
Too much GC alloc
« on: February 27, 2014, 05:35:09 AM »
Why is too much GC alloc for UIRect ? How can i reduce?
Worked on Doc&DogAge Of Fury 3D. Actually working on WarMach.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Too much GC alloc
« Reply #1 on: February 27, 2014, 08:54:41 AM »
The UIEventTrigger will likely be something you load when you click a button. Try to fold it out to see where the GC actually happens.

The UIRect one sounds weird - seems like there's a bunch of string stuff left over, but that doesn't account for 3+MB.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Too much GC alloc
« Reply #2 on: February 27, 2014, 04:59:11 PM »
A Deep Profile view would help you determine where the allocation really happens.

PoN

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 111
    • View Profile
Re: Too much GC alloc
« Reply #3 on: March 04, 2014, 08:53:37 PM »
so now pic with deep profile, have any idea?
Worked on Doc&DogAge Of Fury 3D. Actually working on WarMach.

rain

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 4
  • Posts: 79
    • View Profile
Re: Too much GC alloc
« Reply #4 on: March 05, 2014, 06:04:00 AM »
Why are you instantiating so much stuff at once?  ???

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Too much GC alloc
« Reply #5 on: March 05, 2014, 06:09:59 AM »
You're instantiating a lot of stuff, so of course it will result in GC allocation and a performance hit.

PoN

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 111
    • View Profile
Re: Too much GC alloc
« Reply #6 on: March 05, 2014, 10:25:12 AM »
Why are you instantiating so much stuff at once?  ???
i use NGUITools.AddChild, so have any idea for improve perf. ? thanks
Worked on Doc&DogAge Of Fury 3D. Actually working on WarMach.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Too much GC alloc
« Reply #7 on: March 06, 2014, 08:51:00 AM »
Consider putting them in bigger prefabs, so you don't have to instantiate as many things. Instantiation has a considerable overhead,