Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: PoN on February 27, 2014, 05:35:09 AM

Title: Too much GC alloc
Post by: PoN on February 27, 2014, 05:35:09 AM
Why is too much GC alloc for UIRect ? How can i reduce?
Title: Re: Too much GC alloc
Post by: Nicki 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.
Title: Re: Too much GC alloc
Post by: ArenMook on February 27, 2014, 04:59:11 PM
A Deep Profile view would help you determine where the allocation really happens.
Title: Re: Too much GC alloc
Post by: PoN on March 04, 2014, 08:53:37 PM
so now pic with deep profile, have any idea?
Title: Re: Too much GC alloc
Post by: rain on March 05, 2014, 06:04:00 AM
Why are you instantiating so much stuff at once?  ???
Title: Re: Too much GC alloc
Post by: ArenMook 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.
Title: Re: Too much GC alloc
Post by: PoN 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
Title: Re: Too much GC alloc
Post by: Nicki 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,