Performance Optimization - Memory Optimization

date version Explanation Author
2019-8-15 1.0 The initial version of the document Li Jun

Resource Leak


  1. Uniform Resource Load
    DKAssetManager: LoadObjectSync
    DKAssetManager: LoadObjectAsync each has a unique guid load

  2. Contrast resource snapshot
    into the main city of the time, the following snapshot, snapshots guid
    after a period of time and other games, and then the next snapshot, get the difference guid

The code leak


  1. Callback leak
    shut down the cache, compared to growth of callback sources
  2. The key target release
    ui object releases End, find references path
  3. Table detecting large
    global conveniently find the table 100 contains more elements than the above given path
  4. Configuration table
    format conversion table and release large configuration logic configuration, export format does not meet the demand, a new generation was originally a sort table
  5. + Table.const speed up garbage collection
    garbage collection parameters increased to 600 table.const the same configuration table xlua new clearnull, c # test found objects destroy the advance cleared quote

Resource consumption


  1. Resource format
    texture readwrite enable mipmap mesh readable, pay attention to save the mesh asset, double the memory, with fbxexporter

  2. rt
    some component implementation, such as shadowproject, in ondisable time, full-screen interface is not deleted rt rt rt consideration of non-implementation

  3. ShaderLab
    Standard clean-up, clean-up material ball, with clean-up fbx default shader uber.shader accounted 20M shader clear reference to the default map

  4. Atlas
    small Atlas strategy, it can not close the batch, and the width and height is an integer multiple of 4, consider Figure scattered dynamically loaded separately from the static reference map

  5. Effects
    delete unwanted nodes

  6. ui prefab
    pictures node interface will modify the image, do not drag map

  7. Shaders
    clean up useless references

Resource Management

  1. From the whole cache, positive change to focus on the release released + buffer queue

  2. To minimize the global cache + buffer queues into asynchronous

  3. unload ab (false)
    ab contains only one active load resources, and not be dependent on any ab loaded after the completion of ab unloadfalse, after using the load out of the asset, mainly Atlas

Black &

  1. QualitySettings.masterTextureLimit

Resource Production


  1. Check excessive resources

  2. Reduce resource reference relationship

  3. Clean up useless resources

Guess you like

Origin www.cnblogs.com/marcher/p/12161492.html