Search Issue Tracker

By Design

Votes

0

Found in [Package]

0.2.5-preview.1

Issue ID

1216731

Regression

No

BlobAssetReference is never disposed when created at runtime

Package: Unity Physics

-

How to reproduce:
1. Open the attached project "1216731.zip"
2. Open the Task Manager/Activity Monitor
3. Open the Sample Scene
4. Enter Play mode

Expected result: Memory usage remains similar
Actual result: Memory usage is rising every frame

Reproducible with: 2019.3.1f1 (Physics 0.2.2, 0.2.5-preview.1), 2020.1.0a22 (Physics 0.2.5-preview.1)

Notes:
Unity Physics package is not available in Unity 2018.4, therefore the issue is not reproducible.
The memory is not deallocated even after Play mode exit.
Could not test on earlier package versions due to the console errors.

  1. Resolution Note:

    Blob assets have explicit ownership so they need to be manually disposed when no longer needed. The only exception to this is if they are created during scene conversion and serialized into a scene, then the blob asset is owned by the scene and will be deallocated when the scene is unloaded. For now there are no plans for making it possible to query if a blob asset needs disposing. The reason for not exposing this is that we might end up optimizing away the header of the blob assets when packing them into one block in a subscene. Documentation will be updated to clarify when created colliders need to be disposed.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.