Comment 22 for bug 952108

Revision history for this message
Misaki (myjunkmail311006) wrote :

I don't know if there are multiple memory leaks, but I am reporting on this one. The Bugzilla report is not relevant to my particular version as one comment on Bugzilla says this:

>Obviously also related to wcslen so correctly closed as NOTABUG in Nautilus because it is not a bug in Nautilus.

wcslen is described as "Get wide string length. Returns the length of the C wide string wcs. This is the number of wide characters between ..."

So while the Bugzilla report as marked as RESOLVED DUPLICATE, I am reporting a new issue.

Steps to replicate:

1) Open a folder with many image files.
2) Change to list view.
3) zoom to maximum size, it's faster this way but still happens at normal size.
4) Scroll up and down.

Result, nautilus will use more memory.

The fact that it leaks memory faster at a higher zoom level indicates that it isn't related to the length of strings, but rather has to do with images somehow.

This doesn't happen in icon view. What does happen in icon view, if you zoom to maximum size, is that nautilus temporary uses more memory while it caches higher-resolution thumbnails it generates, possibly only if the existing thumbnails aren't large enough. But most or all of this memory is freed when you reload the folder or navigate away. This doesn't happen with the memory from this leak. Memory usage does go down slightly, like for me it just went from ~830 MiB or something to 780 when I went from list view to icon view, but when I did this after zooming in icon view, it went from ~230 to ~60 MiB.

When I was testing this before, it seemed like the memory didn't leak until you had scrolled far enough; just scrolling a bit, like half a page on normal zoom, didn't seem to cause a leak even when repeated. But using a high zoom makes it easy enough to replicate that details like that shouldn't matter.

In fact, simply increasing the zoom level could cause a memory leak. I just did that, without scrolling, and watched memory usage go from ~780, where I was before, up to 975 MiB. After returning to normal zoom and refreshing, memory went down to ~914. After repeating the process, over 1 GiB.

At normal size, in list view, scrolling down to the bottom of 342 images and then back up to the top causes Nautilus to use about 20 MiB more memory, each time you do it. In icon view, doing this has no noticeable effect. However, changing to list view, and then changing back to icon view, with no other actions taken, does cause memory to increase by about 6 MiB each time I do it.

New thumbnail creation is probably happening because there is high CPU use; it's possible it's not caching thumbnails in list view., or caching a limited amount or number and not freeing memory after it decides a thumbnail is no longer cached. At largest zoom, each image was adding 1.3 MiB of memory to Nautilus when I pressed down once; same thing if I pressed 'home' and 'end' repeatedly.

I'm using Nautilus 3.10.1, with Ubuntu 14.10.