After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 774232 - nautilus progressively uses more and more memory while moving large amounts of files between disks.
nautilus progressively uses more and more memory while moving large amounts o...
Status: RESOLVED OBSOLETE
Product: nautilus
Classification: Core
Component: File and Folder Operations
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-10 21:36 UTC by Hussam Al-Tayeb
Modified: 2021-06-18 15:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
valgrind log while moving 160k files between two hard disks. (123.63 KB, text/x-log)
2016-11-10 21:36 UTC, Hussam Al-Tayeb
  Details
file: unref emblem (911 bytes, patch)
2016-11-12 21:49 UTC, Ernestas Kulik
none Details | Review
clipboard: free item list (1.25 KB, patch)
2016-11-12 21:49 UTC, Ernestas Kulik
none Details | Review
new valgrind log. moving files then deleting them. (103.38 KB, text/x-log)
2016-11-12 22:17 UTC, Hussam Al-Tayeb
  Details
file-operations: free delete progress details string (885 bytes, patch)
2016-11-13 11:14 UTC, Ernestas Kulik
none Details | Review
file: unref emblem (1.07 KB, patch)
2016-11-13 11:34 UTC, Ernestas Kulik
committed Details | Review
clipboard: free item list (1.25 KB, patch)
2016-11-13 11:34 UTC, Ernestas Kulik
committed Details | Review
file-operations: free delete progress details string (975 bytes, patch)
2016-11-23 20:07 UTC, Ernestas Kulik
none Details | Review
file-operations: take progress details string (969 bytes, patch)
2016-11-23 20:08 UTC, Ernestas Kulik
committed Details | Review

Description Hussam Al-Tayeb 2016-11-10 21:36:01 UTC
Created attachment 339545 [details]
valgrind log while moving 160k files between two hard disks.

nautilus progressively uses more and more memory while moving large amounts of files between disks.
moving 160k files totalling 1GB consumed 60~MB and it was not released at the end.
I have a valgrind log.

Note: This isn't the end of the world since nautilus can be easily restarted.
There are some gvfsd-metadata leaks that are probably higher priority.

But I thought I should file a report in case the root cause is the same.
Comment 1 Ernestas Kulik 2016-11-12 21:49:37 UTC
Created attachment 339722 [details] [review]
file: unref emblem

The emblem acquired in apply_emblems_to_icon () is not unreffed as it
should be, since g_emblemed_icon_add_emblem () adds a ref to it.
Comment 2 Ernestas Kulik 2016-11-12 21:49:42 UTC
Created attachment 339723 [details] [review]
clipboard: free item list

The item list in nautilus_clipboard_is_cut_from_selection_data () is
never freed.
Comment 3 Ernestas Kulik 2016-11-12 21:50:11 UTC
While not directly related, these are visible in the log.
Comment 4 Hussam Al-Tayeb 2016-11-12 22:17:03 UTC
Created attachment 339724 [details]
new valgrind log. moving files then deleting them.

I have a new valgrind log with the patches.
I moved 1.4K files then deleted them.
Comment 5 Ernestas Kulik 2016-11-13 11:14:59 UTC
Created attachment 339744 [details] [review]
file-operations: free delete progress details string

The details string in report_delete_progress is not being freed after
use.
Comment 6 Ernestas Kulik 2016-11-13 11:15:38 UTC
This also appears in your log a lot.
Comment 7 Ernestas Kulik 2016-11-13 11:34:16 UTC
Created attachment 339745 [details] [review]
file: unref emblem

The emblem acquired in apply_emblems_to_icon () is not unreffed as it
should be, since g_emblemed_icon_add_emblem () adds a ref to it.
Comment 8 Ernestas Kulik 2016-11-13 11:34:24 UTC
Created attachment 339746 [details] [review]
clipboard: free item list

The item list in nautilus_clipboard_is_cut_from_selection_data () is
never freed.
Comment 9 Carlos Soriano 2016-11-22 10:21:57 UTC
Review of attachment 339744 [details] [review]:

This is wrong, no string from ngettext should be freed.
Comment 10 Ernestas Kulik 2016-11-22 10:27:23 UTC
(In reply to Carlos Soriano from comment #9)
> Review of attachment 339744 [details] [review] [review]:
> 
> This is wrong, no string from ngettext should be freed.

ngettext? It comes from f().
Comment 11 Ernestas Kulik 2016-11-22 10:28:14 UTC
(In reply to Ernestas Kulik from comment #10)
> (In reply to Carlos Soriano from comment #9)
> > Review of attachment 339744 [details] [review] [review] [review]:
> > 
> > This is wrong, no string from ngettext should be freed.
> 
> ngettext? It comes from f().

As in, there is a call to eel_strdup_vprintf_with_custom ().
Comment 12 Carlos Soriano 2016-11-22 10:55:39 UTC
ooooh, the issue is that we don't do "take_details" but "set_details", we should change that to take_details :)
Sorry I was in a confused state looking at the ownership.
Comment 13 Carlos Soriano 2016-11-22 17:31:24 UTC
Review of attachment 339745 [details] [review]:

yeah thanks!
Comment 14 Carlos Soriano 2016-11-22 17:32:59 UTC
Review of attachment 339746 [details] [review]:

Looks good, thanks!
Comment 15 Ernestas Kulik 2016-11-23 20:06:42 UTC
(In reply to Carlos Soriano from comment #12)
> ooooh, the issue is that we don't do "take_details" but "set_details", we
> should change that to take_details :)
> Sorry I was in a confused state looking at the ownership.

Ah, yes, I totally overlooked it!
Comment 16 Ernestas Kulik 2016-11-23 20:07:04 UTC
Created attachment 340639 [details] [review]
file-operations: free delete progress details string

The details string in report_delete_progress is not being freed after
use.
Comment 17 Ernestas Kulik 2016-11-23 20:08:45 UTC
Created attachment 340640 [details] [review]
file-operations: take progress details string

Progress info details are set instead of taken, resulting in a string
leak.
Comment 18 Ernestas Kulik 2016-11-23 20:19:36 UTC
Attachment 339745 [details] pushed as 2dc2983 - file: unref emblem
Attachment 339746 [details] pushed as 12476f4 - clipboard: free item list
Comment 19 Ernestas Kulik 2016-11-23 20:20:50 UTC
It would be great if someone else could find the time to investigate this further, since it’s that busy time of the year again for me.
Comment 20 Carlos Soriano 2017-01-04 09:40:46 UTC
Review of attachment 340640 [details] [review]:

yay :D
Comment 21 Carlos Soriano 2017-01-04 09:41:05 UTC
feel free to backport to 3.22
Comment 22 Ernestas Kulik 2017-01-04 09:47:47 UTC
Comment on attachment 340640 [details] [review]
file-operations: take progress details string

Attachment 340640 [details] pushed as 71ef6d3 - file-operations: take progress details string
Comment 23 André Klapper 2021-06-18 15:47:54 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version of Files (nautilus), then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/nautilus/-/issues/

Thank you for your understanding and your help.