【问题标题】:ScreenshotClient update() call results in memory leakScreenshotClient update() 调用导致内存泄漏
【发布时间】:2017-11-01 07:15:49
【问题描述】:

我正在开发 Jetson TK1 板。我修改了 screencap 应用程序的代码,以在 while 循环中读取屏幕内容并将数据保存为图像。 为此,我使用 ScreenshotClient 类中的 update() 方法。在运行了 100 次 while 循环后,我注意到我的进程的堆大小不断增加。我确实在每次 update() 调用之前调用了 release() 方法。我的代码如下所示。

while(count < 100)
{
    screenshot->release();
    screenshot->update(display, Rect(0, 0), false);
    count++;
}

我不确定这可能是什么原因。任何帮助将不胜感激。

谢谢。

【问题讨论】:

    标签: android screen-capture surfaceflinger


    【解决方案1】:

    请确保您的初始化中有这一行:

    #include <binder/ProcessState.h>
    ...
    android::ProcessState::self()->startThreadPool();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-01-13
      • 2015-10-18
      • 2015-07-06
      • 2014-06-07
      • 2013-11-20
      • 2011-10-28
      • 2016-01-18
      • 2012-12-13
      相关资源
      最近更新 更多