glTexDirectVIVMap memory leak issue in imx6-imx_3.0.35_4.1.0

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

glTexDirectVIVMap memory leak issue in imx6-imx_3.0.35_4.1.0

2,011件の閲覧回数
jasonchenchen
Contributor I

Hi All,

RT.

In our project, we used glTexDirectVIVMap to reduce CPU load, but we found it caused memory leak issue,

how to fix it?  is there the existed patch to fix it?

Source code as follow:

=============================================

v4l2_buffer    v4l2buf;

/* v4l2 setup: MMAP memory mode */

if (ioctl(fd_v4l, VIDIOC_DQBUF, &v4l2buf) < 0)
{
printf("line=%d, fd_v4l, VIDIOC_DQBUF error!!!\n", __LINE__);
return -1;
}

GLuint physical = ~0U;

/* m_pvirtualaddr: mmap(xxx) from V4L2 DMA address, just do mmap one time when v4l2 setup */

glTexDirectVIVMap(GL_TEXTURE_2D, g_cap_width, g_cap_height,
                                          GL_VIV_UYVY, (GLvoid**)&(m_pvirtualaddr), &physical); 

=============================================

ラベル(2)
0 件の賞賛
返信
2 返答(返信)

1,427件の閲覧回数
thomasmcguire
Contributor II

I can confirm this memory leak on Kernel 4.1.15-1.1.0.

We stumbled upon the problem when displaying analog camera video with QtGStreamer. The workaround is to pass the actual physical address to glTexDirectVIVMap(), instead of ~0U. I've created a patch for QtGStreamer here: Bug 730863 – qtvideosink: add i.MX6 zero-copy rendering implementation .

Note that this is just a workaround, and seems to work fine - however the real issue is clearly a Kernel bug, since the memory isn't even freed when the process exits.

0 件の賞賛
返信

1,427件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Jason

L3.0.35_4.1.0 has memory leak issues as answered by experts on

Long running vpu task with memory leak bug on imx6 

one can try L3.0.101

http://www.nxp.com/webapp/Download?colCode=L3.0.101_4.1.1_SOURCE_BSP&appType=license&location=null&P... 

however highly recommended to migrate to new kernels where this is fixed.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信