TransRead: limit the amount of bytes we read at a time
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Thu, 21 Feb 2013 11:06:23 +0000 (13:06 +0200)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Thu, 21 Feb 2013 11:37:06 +0000 (13:37 +0200)
commitaaea1aa1f393202fe29fb277c97e84508993b232
tree168c51442eebd3f34925f9948c11c5698c83ec0d
parent1333d2235701a82cff7d105d096b216c172d78e1
TransRead: limit the amount of bytes we read at a time

In the function which implements fake seek forward we first calculate the
amount of bytes we have to read from the file to seek forward to the requisted
position, and then read that data in one go. However, the seek may be really
far forward, and we'll end up reading really a lot of data in one go, which
leads to high memory consumption.

This patch fixes the issue by limiting the amount of data we read in one go to
1MiB.

Change-Id: Idfdde2e432c216de34b4675e47c859f5e68a2928
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
bmaptools/TransRead.py