Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public NetworkLists potentially being auto instantiated but not disposed leading to a memory leak #3136

Open
ezoray opened this issue Nov 22, 2024 · 0 comments · Fixed by #3148
Assignees
Labels
priority:high stat:import Status - Issue is going to be saved internally type:bug Bug Report

Comments

@ezoray
Copy link

ezoray commented Nov 22, 2024

Description

When a network list is declared public sometimes as part of the serialisation process it looks like the list is instantiated, or at least partially, but it's never disposed leading to a Leak Detected message on the next recompile or play through. The list doesn't appear usable unless Initialise is called on it. Due to this instantiation there's no requirement for your own in Awake but if there is one it has no effect on this.

Public NetworkVariables are also auto instantiated but show no ill effects.

Reproduce Steps

There's a discussion and code example here.

Actual Outcome

Leak log - Leak Detected : Persistent allocates 4 individual allocations.

Expected Outcome

Public network lists are not auto instantiated.

Environment

  • OS: macOS Big Sur
  • Unity Version: 2023.3
  • Netcode Version: 1.11.0

Additional Context

Having a network list public seems to be the only way to see the contents of the list in the inspector as it won't show with [SerializeField].

This issue is also mentioned in #2862.

@ezoray ezoray added stat:awaiting triage Status - Awaiting triage from the Netcode team. type:bug Bug Report labels Nov 22, 2024
@NoelStephensUnity NoelStephensUnity added priority:high stat:import Status - Issue is going to be saved internally and removed stat:awaiting triage Status - Awaiting triage from the Netcode team. labels Dec 2, 2024
@NoelStephensUnity NoelStephensUnity self-assigned this Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:high stat:import Status - Issue is going to be saved internally type:bug Bug Report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants