hecomi / uLipSync

MFCC-based LipSync plug-in for Unity using Job System and Burst Compiler
https://tips.hecomi.com/entry/2022/01/30/152519
MIT License
1.01k stars 125 forks source link

Memory leak in asset import worker #36

Closed ecuzzillo closed 1 year ago

ecuzzillo commented 1 year ago

When I enable leak detection with full stack traces, I have the following error:

I expect this array needs to be disposed somewhere that gets called in asset import workers.

[Worker0] A Native Collection has not been disposed, resulting in a memory leak. Allocated from: — at new Unity.Collections.NativeArray(int length, Allocator allocator, NativeArrayOptions options) at void uLipSync.MfccData.Allocate() in D:/repos/babysteps/babysteps/Library/PackageCache/com.hecomi.ulipsync@5b08f31772/Runtime/Core/Profile.cs:39 at void uLipSync.Profile.OnEnable() in D:/repos/babysteps/babysteps/Library/PackageCache/com.hecomi.ulipsync@5b08f31772/Runtime/Core/Profile.cs:110 at Object UnityEditor.AssetDatabase.LoadMainAssetAtPath(string) at void UnityEditor.Search.AssetIndexer.IndexProperties(in int documentIndex, in string path, in bool hasCustomIndexers) at void UnityEditor.Search.AssetIndexer.IndexDocument(string path, bool checkIfDocumentExists) at void UnityEditor.Search.SearchIndexEntryImporter.OnImportAsset(AssetImportContext ctx) at void UnityEditor.AssetImporters.ScriptedImporter.GenerateAssetData(AssetImportContext ctx)

hecomi commented 1 year ago

I apologize for the delayed response. I've tested the current version (v3.0.2) and found that, even with Full Stack Trace on, there weren't any errors. So, I'm going to close this issue for now. But, if the same problem pops up again in the future, don't hesitate to reopen it. Thank you.

ecuzzillo commented 1 year ago

What version did you test it in? Leak detection was broken in 22.2 until 22.2.14.