question

Weien Meng avatar image
Weien Meng asked

Unity 2021.1.7f1 indicates there is a memory leak

A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
Unity.Collections.NativeArray`1:.ctor(Byte[], Allocator)
UnityEngine.Networking.UploadHandlerRaw:.ctor(Byte[])
PlayFab.PfEditor.PlayFabEditorHttp:MakeApiCall(String, String, GetStudiosRequest, Action`1, Action`1) (at Assets\PlayFabEditorExtensions\Editor\Scripts\PlayFabEditorSDK\PlayFabEditorHttp.cs:74)
PlayFab.PfEditor.PlayFabEditorApi:GetStudios(GetStudiosRequest, Action`1, Action`1) (at Assets\PlayFabEditorExtensions\Editor\Scripts\PlayFabEditorSDK\PlayFabEditorApi.cs:30)
PlayFab.PfEditor.PlayFabEditorDataService:RefreshStudiosList(Boolean) (at Assets\PlayFabEditorExtensions\Editor\Scripts\Utils\PlayFabEditorDataService.cs:198)
PlayFab.PfEditor.PlayFabEditor:OnEnable() (at Assets\PlayFabEditorExtensions\Editor\PlayFabEditor.cs:45)

Above is the stack trace.

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image Seth Du ♦ commented ·

I will try to reproduce this issue. May I what's the version of PlayFab Editor Extension? Are you facing this issue when using the latest version?

0 Likes 0 ·
Weien Meng avatar image Weien Meng Seth Du ♦ commented ·

I am using the latest version, 2.109.210521

0 Likes 0 ·
Weien Meng avatar image Weien Meng Seth Du ♦ commented ·

I am using the latest version, 2.109.210521. The problem persists.

0 Likes 0 ·
Seth Du avatar image
Seth Du answered

There are developers in Unity community reporting similar errors that caused from UnityEngine.Networking.UploadHandlerRaw:.ctor(Byte[]), and it can be reproduced in 2021.1.3f1 and 2021.1.7f1. Please refer to Need help on "A Native Collection has not been disposed, resulting in a memory leak" - Unity Answers.

For now, I suggest using LTS version of Unity, and report this issue to Unity community.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Trent Richards avatar image Trent Richards commented ·

Still enountering this issue on the LTS 2021 version of Unity, 2021.3.11f1. I wasn't having this issue on 2020 version and it popped up when I updated to the 2021 LTS version.

0 Likes 0 ·
Ben R. avatar image
Ben R. answered

2021.2 is now out and this issue with PlayFab remains. The suggested fix is to switch web requests to a using construction which Unity does state as a best practice:

https://docs.unity3d.com/2021.2/Documentation/ScriptReference/Networking.UnityWebRequest.Dispose.html

@SethDu I think this one is going to remain on PlayFab to fix.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

halpar avatar image
halpar answered

Any update on this issue? I still run into it in 2021.2

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

george@thenuum.com avatar image
george@thenuum.com answered

I can't believe this is still around. Is a huge upset. Happens on 2021.3.6 LTS. With the latest playfab. Was so hard to catch on the quest.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.