New issue
Advanced search Search tips

Issue 782198 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

www.500px.tv's slideshow leaks

Reported by hu...@vewd.com, Nov 7 2017

Issue description

Chrome Version: 63.0.3236.7
OS: Linux

What steps will reproduce the problem?
(1) Go to www.500px.tv
(2) Press ENTER to bring up the display.
(3) Press DOWN to enter Full Screen.
(4) Press ENTER again to bring up the display.
(5) Press DOWN to start Slideshow.

Now start looking at the Chrome processes' RSS/PSS and Private Dirty memory by summing SUM X_i (/proc/X_i/smaps).

(6) Let the slide show run for 10 minutes with bellow trick:

    $scope.nextSlide = function() {
        $scope.slideshow.promise = $timeout(function(){
            $scope.advance();
            if($scope.slideshow.running){
                $scope.nextSlide();
            };
        }, 500); // Changed from 7500 to run the slideshow faster.
    }; 

What is the expected result?
The webpage removes old <img>s before appending new ones:

 // remove the first image in the set
 if(scope.current.index > 0){
   $('.flow_wrapper .photo:first-child',element).remove();
 }

Above JQuery results into:

 elem.parentNode.removeChild( elem ); // Removes the <div> that contains the <img>.

Since the <div> containing the <img> is removed, I expected the <img>'s memory to be GC'ed.

What happens instead?
Chrome's sum of Private Dirty memory increases linearly (see attached graph).

I guess the <img>s end up in "discardable memory"? But the cleanup of discardable memory is not done? Why not?

More notes:
When I exit the slideshow by navigating to about:blank the memory is eventually cleaned up (GC'ed). 

However, if leaving the slideshow running for a few hours on a low memory device, we will soon reach out-of-memory.
 
chrome63.png
66.1 KB View Download

Comment 1 by hu...@vewd.com, Nov 9 2017

@erick, I can see that cc > image cache is cleared now and then so I don't think _that_ image cache is leaking. 

Our internal counting, done on chromium 62.0.3202.29, shows that the amount of memory allocated by tcmalloc() grows linearly (chrome62_breakdown.png).

I attached a memory-infra screenshot of Chrome 64.0.3260.2 taken when the renderer's Private Dirty count reaches 250 MB (after running the slideshow in normal pace for about 21h). 

(~ 20 minutes after I took the screenshot Chrome 64 crashed. Hopefully the crash report got uploaded.)
chrome64_hits_250mb_private_dirty__proc_smap_counting.png
58.3 KB View Download
chrome64_hits_250mb_private_dirty__trace.png
114 KB View Download
chrome62_breakdown.png
53.8 KB View Download

Comment 2 by hu...@vewd.com, Nov 13 2017

Status: WontFix (was: Available)
I believe this is a bug in the webpage. DevTools's Memory snapshot tells me the <img>s are left in Detached DOM trees... 
detache_doms.png
590 KB View Download

Sign in to add a comment