Strange memory profile for Mmo in ExitGames-Photon-Server-SDK_v3-4-31-10808

We've been chasing a possible memory leak for a while, but memory profiling doesn't seem to indicate an actual leak. Instead, the amount of unused memory allocated to .NET keeps growing, apparently without bounds.

For comparison, I profiled the Photon Mmo sample, and noticed some unexpected behavior. When I watch the private bytes counter in the ANTS memory profiler, it grows slowly until it gets to about 105 MB, and then shrinks back down to about 84 MB. However, very few, if any, managed objects are getting allocated, so I wouldn't expect the .NET runtime to allocate more system memory for it's managed heaps.

Any idea what might be causing this behavior in the sample?


  • hi, @ssliwinski

    first, we do not support anymore version 3.xxxx. Please upgrade.

    second, what you see running MMO sample can be explained by GS work, which starts to release memory to system after reaching some threshold.

    third, we use .net memory profier to find memory leak. i do not want to say that ANTs is worse or .net memory profiler is better. we just do not use ANTs. in .Net Memory Profiler you may see in snapshot who takes most of the memory. you may compare two snapshots which were done during same session.

    may be this will help

  • I'm not sure what you mean by GS work. Did you mean to say GC work?

    I downloaded the .NET memory profiler (by SciTech), and it does seem better than ANTS. I also upgraded to the latest version of the SDK. However, I'm still observing the same memory pattern.

    And with the improved profiling tools, it's clear that the sample is just generating a ton of garbage, which explains the allocation pattern of the managed heaps.

    However it's odd to me that the sample produces so much garbage in a steady state. If the profiler is to be believed the Mmo sample is generating over 1MB of garbage per second, with no connected clients.

    So no leak, but seems like an excessive amount of garbage generation.
  • I can't confirm your observations. I had a look at the memory profile of the provided MMO example. And while it showed that normal saw tooth profile that is common for GCed applications, it did build up like 1MB per Minute. I got GC in intervals of around 30 seconds, cleaning up around 25MB. And that behaviour is fine. Unless your application is literally doing nothing, this is just the normal memory garbage that builds up.

    I did use the Visual Studio build in memory profiler.
  • I'm definitely seeing a different allocation rate with the MMO sample. Here's a screenshot:
  • hi, ssliwinski

    well, we do not support MMO sampe. it is quite complex and may contain bugs. i tried my self to understand how it works and what it does at least twice. and in both cases i managed to forgot how it works. another developer simplified it, but i'm not sure whether his work was released.

    so, it may contain memory leak. my advise for you, to concentrate on what is goinig on during runtime

Sign In or Register to comment.