FYI - Memory Leak in Network Animator — Oculus
Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

FYI - Memory Leak in Network Animator

ProfessorTroyProfessorTroy Posts: 80 Poster of the Week
Hey Fellow Devs;

Been profiling memory, draw calls and etc. After eliminating/hitting most of my bigger leaks, I noticed a pretty constant leak coming from the Network Animator object. Now, if you are making a network game, this is kind of important, because it *will* eventually trigger a GC that'll definitely give you a FPS hiccup. It's only ~2-4K every few frames, but it adds up over a minute or two.

Anyway, given that there are other known issues with Network Animator, I've basically trashed it from my project.

Best work around for keeping animations "in sync" with each other is to do the following:

1. Create a SyncVar(hook="InputUpdatedX") for both your X/Y inputs for movement if you have any animations tied to these.
2. Create a "RpcTriggerSync" to keep any trigger events up to date. These didn't sync with Network Animator any.
3. Repeat step one for any other state transition types.

In a nutshell, that should keep your players sync'd up, it's a bit more network traffic (actually lower than using network animator) and it keeps your players animations roughly syncronized without the pesky behavior leak.

Cheers,
T
Sign In or Register to comment.