Log in or register to post comments

Unity Image Effects Memory Leak

July 15, 2013 - 4:31pm #1

We want to apply a glow to some objects in our project. However, we are experiencing a memory leak when we try to use Vuforia with any plugin that uses Image Effects. To test this we modified the Image Target example in the following way.

1) In Unity, added a second camera to the scene.

2) added the following script to that camera, to simulate an image effect being applied:

using UnityEngine;
using System.Collections;

public class LeakTest : MonoBehaviour {

	void OnRenderImage(RenderTexture source, RenderTexture destination) {		
		Graphics.Blit(source, destination);
	}
}

3) Test this on an iOS device while running Instruments Activity Monitor.

We observe a very quick memory increase while the Image Targets sample is running. This leads us to believe there is a bug that causes a memory leak when Vuforia is combined with Image Effects.

Example Project:
http://www.gamefront.com/files/23522752/VuforiaMemoryLeak.zip

Any thoughts would be appriciated.

Unity Image Effects Memory Leak

July 24, 2013 - 1:55am #13

This confirmation is great to hear :)

Glad I could help.

N

Unity Image Effects Memory Leak

July 23, 2013 - 12:23pm #12

Thanks again for the help, and heads-up about the Unity update.

I have confirmed that Unity 4.2 has fixed the memory leak issue, both for the Image Targets w/ simple Blit() test, as well as in my real project using the Glow 11 plugin.

 

Unity Image Effects Memory Leak

July 23, 2013 - 8:45am #11

Thank you very much, I will try this immediately. 

For documentation sake I am currently running Unity version 4.1.5f1

I will update and see what happens.

Unity Image Effects Memory Leak

July 23, 2013 - 8:37am #10

Hi

I just tried this with the absolute latest version of Unity 4.2.0f4 and it appears that with this there is no memory leak  i.e. in Activity Monitor the memory utilised stays stable.

I tried this with the minimal script you provided as well as the Glow Effects script.  In both cases the Image Targets scene hovers at around 47/48Mb and does not increase over time.

Please can you try this and confirm it works as expected.

 

regards

N

Unity Image Effects Memory Leak

July 23, 2013 - 7:06am #9

Are there any settings in Vuforia that could atleast improve the issue? For instance, something to make it take up less memory, or anything like that?

Unity Image Effects Memory Leak

July 23, 2013 - 6:11am #8

We are looking at this issue, but unfortunately I cannot give you a time for when it might be fixed.

It would be prudent for you to plan accordingly.

 

N

Unity Image Effects Memory Leak

July 22, 2013 - 8:32pm #7

Any advice on this issue would be greatly appreciated. We already delivered an Alpha with this rather glaring issue, and our Beta delivery is coming up quickly. We need to know very soon if we will be forced to take a different approach for special effects.

Thanks,

Dustin

Unity Image Effects Memory Leak

July 18, 2013 - 1:26am #6

We are investigating and will get back to you.

If the Blit() is commented out then the memory stays the same, so not quite sure what is causing this.

 

N

Unity Image Effects Memory Leak

July 17, 2013 - 8:35am #5

Did that latest project work properly?

Unity Image Effects Memory Leak

July 16, 2013 - 9:37am #4

Sorry about that, please try this file:

VuforiaMemoryLeak.zip

Thanks, 
Dustin

Unity Image Effects Memory Leak

July 16, 2013 - 9:20am #3

Unfortunately the project at link you have supplied is broken because it does not contain all necessary the scripts and components, as they seem to be replaced with symbolic links.

Please try and upload the entire project with all such components.

 

Thanks 

N

 

Unity Image Effects Memory Leak

July 16, 2013 - 8:19am #2

Thanks for this.

I will investigate and get back to you when I have more info.

 

N

Log in or register to post comments