Shader memory leak on ios with metal.

Unity version 4.7

Issue always occur

Here my test:

  1. Build hundred of shader files to an assetBundle.
  2. Load all assets of the assetBundle
  3. Unload the assetBundle and switch to another scene, so all resource should be released.

But using instruments, monitor the memory allocation, there are still some mega bytes memory not released. That’s only happen on ios with metal graphic api.

Based on same example, do these tests.

  1. On ios with opengl es api, no memory leak
  2. On android, no memory leak
  3. If using empty assetBundle, no memory leak

example don’t use these shader to render, so no graphic “shader” api is called like
glShaderSource/glCompileShader and no shader memory allocated on GPU memory
so memory leak should be happed on these points that unity loading shader to memory and compile unity shader to metal shader.

The following image is function backtrace when leak occur.

How to workaround? Any suggestion?

Resolved it.
I disable GPU Frame Capture and Metal API Validation in Xcode, there no leak detected.