puerts icon indicating copy to clipboard operation
puerts copied to clipboard

[UE] 占用内存的优化

Open Tangxinwei opened this issue 3 years ago • 1 comments

在uclass数量较多的时候,本身的反射信息占用的内存量也较多,而且因为会被v8的slow_template_instantiations_cache引用导致无法释放。有两个想法

  1. uclass中的ufunction,可以考虑在ts调用的时候才进行push
  2. 不通过newinstance产生jsobject,这样或许可以规避slow_template_instantiations_cache的引用

Tangxinwei avatar Dec 05 '22 09:12 Tangxinwei

这个commit:https://github.com/Tencent/puerts/commit/2a566c0a3a16e7b192b11819787e2802654814ef 开启PUERTS_REUSE_STRUCTWRAPPER_FUNCTIONTEMPLATE后,能解决反复gc,重新加载蓝图类,导致反复新建同一个类对应的function。

chexiongsheng avatar Dec 12 '22 07:12 chexiongsheng