Performance breakdown in just one frame

My game is running smoothly so far. But once in a while the performance breaks down just for one frame. The execution of this frame takes 350ms (before and after that I have about 10ms).

For the 350ms frame the profiler says its “Loading.LoadFileHeaders” underneath the Camera.Render note what takes so long. I don’t load any files.

Has somebody an idea what that could be?

Thank you guys very much.

Sounds like a weird garbage collection issue. So, do you use any plugins or addons?

Thanks hippocoder.

I have installed a few packages but I don’t use them in the scene. Afaik that should not affect the frame rate.
There is actually not much happen in the scene. One player character (CharacterController), one npc.
7,4 k Tris 55 Drawcalls. I have one big Texture for all the static environment 2048x2048 and simple diffuse or vertexlit shaders.

What version of unity, and what version is the target platform? if you are sure no unity packages are running in your game, and this behaviour still persists on desktop as the target build platform, then you should submit a bug report to unity, because this sounds bizarre :slight_smile:

Google throws up some interest: http://forum.unity3d.com/threads/60016-Preloading-uploading-textures-to-vram-prior-to-first-render

Could be it is just paging the texture to vram for the static mesh. It could be GUI. It could be that there’s a problem with static meshes + large textures. Does it happen when static is unticked?

Good luck with the solution, I don’t think I can help more beyond these suggestions.

I unticked static. It seams its not happen anymore. But even if it is static its not happen that often so I ll have to observe it for the next time. Anyway it was a good advice to get closer to a solution.

I am using unity 3.5 (but it was happen before in 3.41) target is iOs.

Thank you very much again

I’m bumping this because I’m not entirely sure it isn’t a unity bug. A single 2048x2048 texture on a static mesh shouldn’t keep loading the texture onto the GPU. Everything out there has the ram to support that texture. I can only imagine something has been missed here. If it’s really as simple as you say, it’s worth a bug report.

If it happens once, then that’s fine… check how often it occurs perhaps! :slight_smile:

I’m getting this problem as well with or without static batching. It happens occasionally in the game which really puzzles me as I have instantiated all my resources at the start into a resource pool and do no loading of resources at runtime.

DId anyone find a solution for this?

Seems like the only thing you can do is render all of your objects for a frame to load the GPU with the shaders/textures. Kind of annoying. Unity really needs a gpuload function for meshes.