2022-03-20 01:07:13.783 3503-3560/com. E/Unity: Could not allocate memory: System out of memory!
Trying to allocate: 134217728B with 16 alignment. MemoryLabel: Serialization
Allocation happened at: Line:1041 in ./Runtime/Core/Containers/hash_set.h
Memory overview
[ ALLOC_TEMP_THREAD ] used: 32972B | peak: 0B | reserved: 6520832B
[ ALLOC_TEMP_JOB_1_FRAME ] used: 0B | peak: 0B | reserved: 1048576B
[ ALLOC_TEMP_JOB_2_FRAMES ] used: 0B | peak: 0B | reserved: 1048576B
[ ALLOC_TEMP_JOB_4_FRAMES ] used: 0B | peak: 0B | reserved: 6291456B
[ ALLOC_TEMP_JOB_ASYNC ] used: 0B | peak: 0B | reserved: 26214400B
[ ALLOC_DEFAULT ] used: 158255688B | peak: 0B | reserved: 234885120B
[ ALLOC_GFX ] used: 63796468B | peak: 0B | reserved: 100663296B
[ ALLOC_CACHEOBJECTS ] used: 366781156B | peak: 0B | reserved: 529600512B
[ ALLOC_TYPETREE ] used: 11230608B | peak: 0B | reserved: 18874368B
[ ALLOC_PROFILER ] used: 6916208B | peak: 34835676B | reserved: 50331648B
UnityEngine.ResourceManagement.ResourceProviders.AssetBundleResource:GetAssetBundle()
UnityEngine.ResourceM
When moving the scene, a crash occurs and a memory view like the one above appears.
At first I checked the memory profiler as it was an OOM issue, but no increasing memory was detected.
no backtrace here
How can I solve this case?
---
if (SceneManager.sceneCount > 1)
{
string strOldSceneName = SceneManager.GetActiveScene().name;
if (!strOldSceneName.Equals("UI"))
{
AsyncOperation asyncOperationDelete = SceneManager.UnloadSceneAsync(strOldSceneName);
yield return asyncOperationDelete;
}
}
UnloadUnusedAssets();
AsyncOperationHandle asyncOperationHandle = Addressables.LoadSceneAsync(m_strSceneName.ToLower(), LoadSceneMode.Additive, true, 0);
yield return new WaitUntil(() => (asyncOperationHandle.PercentComplete >= 0.9f));
yield return new WaitUntil(() => (asyncOperationHandle.PercentComplete == 1));
SceneManager.SetActiveScene(asyncOperationHandle.Result.Scene);
This crash occurs while moving the scene and this is my scene moving code.
The UI is not unloaded, only the game scene is modified.
↧