Forum Discussion
wangxiaogangan
7 years agoExplorer
360 video compositor layer make memory leak when re-open video file repeat many times
the post https://forums.oculusvr.com/developer/discussion/68089/compositor-layer-using-for-render-360-video-make-render-result-judder#latest tell me how to prevent video judder, but another problem which occurs in great probability is memory leak while i close & reopen same video file over and over again (rendering with overlay). the log repeat 3 - 7 times, showing below:
the phenomenon is beyond comprehension, when i first open video, no matter how many times deactive & reactive overlay ( recreate layertexture & do not close video), everything is fine, no error log.
but while i reopen the same video file, the error log occurs, which shows that error is texture memory error. if i do not copy texture from PopulateLayer, there will be nothing rendered, and no error log occurs.
could someone give me an infer for what i do wrong in reopen video and caused memory leak?
should i write data directly into swapchain's et and abandon videotexture copy?
the phenomenon is beyond comprehension, when i first open video, no matter how many times deactive & reactive overlay ( recreate layertexture & do not close video), everything is fine, no error log.
but while i reopen the same video file, the error log occurs, which shows that error is texture memory error. if i do not copy texture from PopulateLayer, there will be nothing rendered, and no error log occurs.
private bool PopulateLayer(int mipLevels, bool isHdr, OVRPlugin.Sizei size, int sampleCount)
{
for (int eyeId = 0; eyeId < texturesPerStage; ++eyeId)
{
int stage = frameIndex % stageCount;
Texture et = layerTextures[eyeId].swapChain[stage];
if (et == null)
continue;
// disable copy texture can prevent the error if i reopen the video, but there will be nothing rendered
Graphics.CopyTexture(videotexture, 0, 0,
0, 0, videotexture.width, videotexture.height,
et, 0, 0, 0, 0);
}
}1.the videotexture is unity texture2d, which data copied from surfacetexture in native plugin. videotexture will re-new if reopen video
2.if i always copy a static empty texture into swapchain's et, error still occurs when i reopened file
3.the videotexture & swapchain texture format both are rgba32could someone give me an infer for what i do wrong in reopen video and caused memory leak?
should i write data directly into swapchain's et and abandon videotexture copy?
1 Reply
Replies have been turned off for this discussion
- wangxiaoganganExplorerupdate 8/18/2018:1.i found that accompanied by the above "out of memory" log printing, the device's eye buffer shows a lot of random noise point with random color at the same time while overlay is rendering, but this phenomenon just last a few frames and disappear.if i open same video over and over again, this behavior will re-new texture2d with video's resolution and destory it late after video close. when video's resolution is above 4k * 2k, the occur probability of "out of mem" increase greatly.so, if i resize texture2d when re-open video file instead of new texture2d , the occur probability of "out of meme" decrease but not disappear. could someone give me the correlation with new texture2d (i am sure i will destrory it later ) and "out of mem"? (the noise point is ignored and i can not figure out how to avoid it)2. the overlay type = Equirect, i can not ctrl overlay's position with current sdk. this mean i can not change the relative position between main camera and video sphere. when playing video, i want change main camera's height and forward to watch video at dynamic position. could you add an interface for changing overlay equirect's position not just the rotation in the future sdk?
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 7 years ago