Version: 2022.3
LanguageEnglish
  • C#

AssetBundle.memoryBudgetKB

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static uint memoryBudgetKB;

Description

Controls the size of the shared AssetBundle loading cache. Default value is 1MB.

Depending on your AssetBundle build and load strategy, sections of the AssetBundle file may be accessed multiple times. To improve loading performance, the AssetBundle loading cache stores recently accessed pages of the AssetBundle file. The default cache size should be sufficient in most cases, but the optimal cache size may vary depending on your workload. The optimal size can be determined by measuring how different cache sizes affect the AssetBundle loading times of your specific workload. If you load lots of small objects (e.g. 100 addressable prefabs) individually out of an AssetBundle, a larger cache would likely improve performance since future reads of other objects might reuse cached pages. If your AssetBundle consists of fewer large objects, or if you read all your objects simultaneously with functions like AssetBundle.LoadAll, a larger cache may not help since the cached pages will likely not be revisited.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961