gc 优化方案

gc优化方案

1 内存(堆)资源无法满足分配空间,gc进行无用内存(堆)空间释放
2 update,fixedUpdate (new string)
   对象池 
   stringBuilder 代替 string
   list指定大小

3 引擎自身导致问题
   update,fixedUpate(tag, getcompnent)

   词典判定方式,
   getcomponent 提前获取

4 装箱(栈数据转堆数据)
   tostring()

   lINQ

5 foreach 

   用 for来进行代替

6 场景切换手动调用 gc.collect, 进行内存占用释放
 

相关文章:

  • 2021-12-24
  • 2022-12-23
  • 2021-12-26
  • 2019-09-01
  • 2021-05-31
  • 2022-12-23
  • 2021-06-14
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
  • 2022-03-03
  • 2021-04-03
  • 2021-11-13
相关资源
相似解决方案