puerts
puerts copied to clipboard
[UE] 占用内存的优化
在uclass数量较多的时候,本身的反射信息占用的内存量也较多,而且因为会被v8的slow_template_instantiations_cache引用导致无法释放。有两个想法
- uclass中的ufunction,可以考虑在ts调用的时候才进行push
- 不通过newinstance产生jsobject,这样或许可以规避slow_template_instantiations_cache的引用
这个commit:https://github.com/Tencent/puerts/commit/2a566c0a3a16e7b192b11819787e2802654814ef 开启PUERTS_REUSE_STRUCTWRAPPER_FUNCTIONTEMPLATE后,能解决反复gc,重新加载蓝图类,导致反复新建同一个类对应的function。