Loading services/surfaceflinger/BufferStateLayer.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,14 @@ void BufferStateLayer::onLayerDisplayed(const sp<Fence>& releaseFence) { void BufferStateLayer::onSurfaceFrameCreated( const std::shared_ptr<frametimeline::SurfaceFrame>& surfaceFrame) { while (mPendingJankClassifications.size() >= kPendingClassificationMaxSurfaceFrames) { // Too many SurfaceFrames pending classification. The front of the deque is probably not // tracked by FrameTimeline and will never be presented. This will only result in a memory // leak. ALOGW("Removing the front of pending jank deque from layer - %s to prevent memory leak", mName.c_str()); mPendingJankClassifications.pop_front(); } mPendingJankClassifications.emplace_back(surfaceFrame); } Loading services/surfaceflinger/BufferStateLayer.h +2 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,8 @@ private: nsecs_t mCallbackHandleAcquireTime = -1; std::deque<std::shared_ptr<android::frametimeline::SurfaceFrame>> mPendingJankClassifications; // An upper bound on the number of SurfaceFrames in the pending classifications deque. static constexpr int kPendingClassificationMaxSurfaceFrames = 25; const std::string mBlastTransactionName{"BufferTX - " + mName}; // This integer is incremented everytime a buffer arrives at the server for this layer, Loading Loading
services/surfaceflinger/BufferStateLayer.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,14 @@ void BufferStateLayer::onLayerDisplayed(const sp<Fence>& releaseFence) { void BufferStateLayer::onSurfaceFrameCreated( const std::shared_ptr<frametimeline::SurfaceFrame>& surfaceFrame) { while (mPendingJankClassifications.size() >= kPendingClassificationMaxSurfaceFrames) { // Too many SurfaceFrames pending classification. The front of the deque is probably not // tracked by FrameTimeline and will never be presented. This will only result in a memory // leak. ALOGW("Removing the front of pending jank deque from layer - %s to prevent memory leak", mName.c_str()); mPendingJankClassifications.pop_front(); } mPendingJankClassifications.emplace_back(surfaceFrame); } Loading
services/surfaceflinger/BufferStateLayer.h +2 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,8 @@ private: nsecs_t mCallbackHandleAcquireTime = -1; std::deque<std::shared_ptr<android::frametimeline::SurfaceFrame>> mPendingJankClassifications; // An upper bound on the number of SurfaceFrames in the pending classifications deque. static constexpr int kPendingClassificationMaxSurfaceFrames = 25; const std::string mBlastTransactionName{"BufferTX - " + mName}; // This integer is incremented everytime a buffer arrives at the server for this layer, Loading