microsoft / MixedRealityCompanionKit

This is a MixedRealityToolkit style repository for code bits and components that may not run directly on Microsoft HoloLens or immersive headsets but instead pair with them to build experiences.
MIT License
595 stars 288 forks source link

compositor hangs - possible memory leak with compositor.dll #201

Open nstolting opened 7 years ago

nstolting commented 7 years ago

Everything starts correctly, the compositor window displays the correct image and responds correctly to the head movement etc.

However, after launching the compositor window, I notice the memory usage for unity continually increases. At some point (>=1.5GB) the compositor window stops responding to head movement and displays a static image that never responds to changes. The feed from the camera continues to stream correctly.

I've tried connecting the windows debugger but have yet to find the process or thread that is actually eating up the memory.

I have tried building with different versions of openCV to see if the problem was in openCV rather than the compositor.dll.

Our spectator rig consists of a Nikon 7200, a Elgato HD 60S card.

I'm wondering if this issue has ever been seen before.

eluchsinger commented 6 years ago

I have been having this issue also. There must be a memory leak in the MRVC code. The memory usage starts ramping up after some time, until reaching around 1 GB, where it then crashes the application. I can't find anything causing this issue in the C# code. My heap size is at most 40 MB.

nstolting commented 6 years ago

I meant to update this issue, we found an issue with our application that was generating several debug messages per frame in relation to the custom messages. After removing the debug messages, our memory issues went away. Our hypothesis was that due to the number of debug messages being generated these couldn't be written out quickly enough and so the consumed memory built up over time.

eluchsinger commented 6 years ago

@nstolting Thanks for the heads up. Will try that out ASAP.

eluchsinger commented 6 years ago

@nstolting do those messages have anything to do with the MRVC? Where do they come from?

nstolting commented 6 years ago

The messages that I was referring too were some debug messages that we had added into our application to verify that the HoloLens spectator view was working correctly.