unity 3D 内存管理
1. 避免使用str+=“dddd” 。 string每次赋值,就是重新的分配内存。 如果要多次+字符串,采用stringbuilder。
2.使用索引 a[i] 而不是 a0 = a[0] .
3. 多使用struct 等数据结构,因为他是分配连续的内存,便于管理。
http://en.wikipedia.org/wiki/Object_pool_pattern
http://www.memorymanagement.org/
http://sourcemaking.com/design_patterns/object_pool

浙公网安备 33010602011771号