diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-17 18:58:01 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-17 18:58:01 +0000 |
commit | dd8ac359edca83603382f76c096b0cafbef93688 (patch) | |
tree | d063b83f8962e05cbbb2983243df314cf5e86f27 /net | |
parent | ff1f9df48c3925e022e5c66bca7fa42278ccb354 (diff) | |
download | chromium_src-dd8ac359edca83603382f76c096b0cafbef93688.zip chromium_src-dd8ac359edca83603382f76c096b0cafbef93688.tar.gz chromium_src-dd8ac359edca83603382f76c096b0cafbef93688.tar.bz2 |
An adhoc fix for memory leak when playing a badly muxed video file
Since the current data souce implementation for media resource loading
assumes forward reading, when playing some badly muxed video files that
has out-of-order read patterns a memory leak is observed. Here's the reason:
1. The video file has out-of-order read pattern
2. A lot of BufferedResourceLoader is created and destroyed to accomodate
the seek requests that cannot be served by the buffer.
3. BufferedResourceLoader is not destroyed immediately when a new request
is made, it is destroyed when the request has completed (triggered by
cancelling the request).
4. Since request completion comes at a much lower rate than creation of
BufferedResourceLoader, a lot of BufferedResourceLoader are remain
alive and keep increasing, a leak is resulted.
Adhoc solution:
We can destroy all buffers in BufferedResourceLoader when it is called
to stop. This can greatly reduce the leak amount. Although a lot of
BufferedResourceLoader are still alive, they will be destroyed eventually
(since a request completion is received due to cancelling of the request).
A better solution would be to destroy the BufferedResourceLoader right away
after it is stopped and fix the leak in ResourceDispatcher so we don't need
to lengthen the lifetime of BufferedResourceLoader.
CL for fixing ResourceDispatcher:
http://codereview.chromium.org/115396
Review URL: http://codereview.chromium.org/115394
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16262 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions