OSDN Git Service

Make Mtp FFS allocations per session rather than per file
authorJerry Zhang <zhangjerry@google.com>
Fri, 27 Jan 2017 18:29:59 +0000 (10:29 -0800)
committerJerry Zhang <zhangjerry@google.com>
Thu, 2 Feb 2017 20:38:00 +0000 (12:38 -0800)
commitcc9d0fdd302cf997607055e0a8b5559509cba766
tree9dd0c4129717288a07246f23c6492fcb5a6daad1
parentf41c781cf4500cb0a8aae017f0c802c7b6f52f05
Make Mtp FFS allocations per session rather than per file

Workloads that send a large number of small files could
repeatedly allocate and free the buffer, causing fragmentation
and eventually running out of allocable memory. Instead
have the allocation be once per MTP session, and retry
with smaller buffers if it fails initially.

Bug: 34741015
Bug: 34822471
Test: Transfer files via MTP
Change-Id: I775376076d3a0c26765b211100830ea0c08450ef
media/mtp/MtpFfsHandle.cpp
media/mtp/MtpFfsHandle.h
media/mtp/MtpServer.cpp