linuxmint / mint21.1-beta

BETA Bug Squash Rush
7 stars 0 forks source link

mintupdate: High CPU and memory use #54

Closed kancolle386 closed 1 year ago

kancolle386 commented 1 year ago

I noticed high memory use of mintUpdate, and CPU use in "Refresh" operation.

Here is the documentations. PID of mintUpdate is 5810.

mtwebster commented 1 year ago

Not going to close this yet, but I'll link some commits that should greatly reduce overhead when checking updates.

https://github.com/linuxmint/mintcommon/commit/d845884248214d05b7f93c344868ec386ee82436 https://github.com/linuxmint/mintupdate/commit/eef74ad7b5206e17b3559ef92cab86c1f5825d70 https://github.com/linuxmint/cinnamon/commit/108b77756b64620241f842622231a3412f6eeb28

clefebvre commented 1 year ago

It's all in the repositories now.

Tibladar commented 1 year ago

mintupdate still hogs too much RAM with updates applied and a reboot: ram

clefebvre commented 1 year ago

Confirmed

Tibladar commented 1 year ago

Disabling flatpak support drops RAM usage to couple MBs grafik

A very short profiling session led to somewhere in flatpakUpdater.py and then probably to mintcommon.

profiler output ``` Filename: mintUpdate.py Line # Mem usage Increment Occurrences Line Contents ============================================================= 765 93.9 MiB 93.9 MiB 1 @profile 766 def run(self): 767 93.9 MiB 0.0 MiB 1 if self.application.refreshing: 768 return False 769 770 93.9 MiB 0.0 MiB 1 if self.application.updates_inhibited: 771 self.application.logger.write("Updates are inhibited, skipping refresh") 772 self.show_window() 773 return False 774 775 93.9 MiB 0.0 MiB 1 self.application.refreshing = True 776 93.9 MiB 0.0 MiB 1 self.running = True 777 778 93.9 MiB 0.0 MiB 1 if self.root_mode: 779 while self.application.dpkg_locked(): 780 self.application.logger.write("Package management system locked by another process, retrying in 60s") 781 time.sleep(60) 782 783 93.9 MiB 0.0 MiB 1 self.application.cache_watcher.pause() 784 785 93.9 MiB 0.0 MiB 1 Gdk.threads_enter() 786 93.9 MiB 0.0 MiB 1 self.vpaned_position = self.application.paned.get_position() 787 93.9 MiB 0.0 MiB 1 for child in self.application.infobar.get_children(): 788 child.destroy() 789 93.9 MiB 0.0 MiB 1 if self.application.reboot_required: 790 self.application.show_infobar(_("Reboot required"), 791 _("You have installed updates that require a reboot to take effect, please reboot your system as soon as possible."), icon="system-reboot-symbolic") 792 93.9 MiB 0.0 MiB 1 Gdk.threads_leave() 793 794 93.9 MiB 0.0 MiB 1 try: 795 93.9 MiB 0.0 MiB 1 if self.root_mode: 796 self.application.logger.write("Starting refresh (retrieving lists of updates from remote servers)") 797 else: 798 93.9 MiB 0.0 MiB 1 self.application.logger.write("Starting refresh (local only)") 799 93.9 MiB 0.0 MiB 1 Gdk.threads_enter() 800 # Switch to status_refreshing page 801 93.9 MiB 0.0 MiB 1 self.application.status_refreshing_spinner.start() 802 93.9 MiB 0.0 MiB 1 self.application.stack.set_visible_child_name("status_refreshing") 803 93.9 MiB 0.0 MiB 1 if not self.application.app_hidden(): 804 self.application.window.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH)) 805 93.9 MiB 0.0 MiB 1 self.application.toolbar.set_sensitive(False) 806 93.9 MiB 0.0 MiB 1 self.application.menubar.set_sensitive(False) 807 93.9 MiB 0.0 MiB 1 self.application.builder.get_object("tool_clear").set_sensitive(False) 808 93.9 MiB 0.0 MiB 1 self.application.builder.get_object("tool_select_all").set_sensitive(False) 809 93.9 MiB 0.0 MiB 1 self.application.builder.get_object("tool_apply").set_sensitive(False) 810 811 # Starts the blinking 812 93.9 MiB 0.0 MiB 1 self.application.set_status(_("Checking for package updates"), _("Checking for updates"), "mintupdate-checking-symbolic", not self.application.settings.get_boolean("hide-systray")) 813 93.9 MiB 0.0 MiB 1 Gdk.threads_leave() 814 815 93.9 MiB 0.0 MiB 1 model = Gtk.TreeStore(bool, str, str, str, str, int, str, str, str, str, str, object) 816 # UPDATE_CHECKED, UPDATE_DISPLAY_NAME, UPDATE_OLD_VERSION, UPDATE_NEW_VERSION, UPDATE_SOURCE, 817 # UPDATE_SIZE, UPDATE_SIZE_STR, UPDATE_TYPE_PIX, UPDATE_TYPE, UPDATE_TOOLTIP, UPDATE_SORT_STR, UPDATE_OBJ 818 819 93.9 MiB 0.0 MiB 1 model.set_sort_column_id(UPDATE_SORT_STR, Gtk.SortType.ASCENDING) 820 821 # Refresh the APT cache 822 93.9 MiB 0.0 MiB 1 if self.root_mode: 823 refresh_command = ["sudo", "/usr/bin/mint-refresh-cache"] 824 if not self.application.app_hidden(): 825 refresh_command.extend(["--use-synaptic", 826 str(self.application.window.get_window().get_xid())]) 827 subprocess.run(refresh_command) 828 self.application.settings.set_int("refresh-last-run", int(time.time())) 829 830 93.9 MiB 0.0 MiB 1 if CINNAMON_SUPPORT: 831 93.9 MiB 0.0 MiB 1 if self.root_mode: 832 self.application.logger.write("Refreshing available Cinnamon updates from the server") 833 self.application.set_status_message(_("Checking for Cinnamon spices")) 834 for spice_type in cinnamon.updates.SPICE_TYPES: 835 try: 836 self.application.cinnamon_updater.refresh_cache_for_type(spice_type) 837 except: 838 self.application.logger.write_error("Something went wrong fetching Cinnamon %ss: %s" % (spice_type, str(sys.exc_info()[0]))) 839 print("-- Exception occurred fetching Cinnamon %ss:\n%s" % (spice_type, traceback.format_exc())) 840 841 93.9 MiB 0.0 MiB 1 if FLATPAK_SUPPORT: 842 93.9 MiB 0.0 MiB 1 self.application.logger.write("Refreshing available Flatpak updates") 843 93.9 MiB 0.0 MiB 1 self.application.set_status_message(_("Checking for Flatpak updates")) 844 147.6 MiB 53.7 MiB 1 self.application.flatpak_updater.refresh(full=self.root_mode) 845 846 257.6 MiB 110.0 MiB 1 self.application.set_status_message(_("Processing updates")) 847 848 257.6 MiB 0.0 MiB 1 if os.getenv("MINTUPDATE_TEST") == None: 849 275.9 MiB 18.3 MiB 1 output = subprocess.run("/usr/lib/linuxmint/mintUpdate/checkAPT.py", stdout=subprocess.PIPE).stdout.decode("utf-8") 850 else: 851 if os.path.exists("/usr/share/linuxmint/mintupdate/tests/%s.test" % os.getenv("MINTUPDATE_TEST")): 852 output = subprocess.run("sleep 1; cat /usr/share/linuxmint/mintupdate/tests/%s.test" % os.getenv("MINTUPDATE_TEST"), shell=True, stdout=subprocess.PIPE).stdout.decode("utf-8") 853 else: 854 output = subprocess.run("/usr/lib/linuxmint/mintUpdate/checkAPT.py", stdout=subprocess.PIPE).stdout.decode("utf-8") 855 856 275.9 MiB 0.0 MiB 1 error_found = False 857 858 # Return on error 859 275.9 MiB 0.0 MiB 1 if "CHECK_APT_ERROR" in output: 860 error_found = True 861 self.application.logger.write_error("Error in checkAPT.py, could not refresh the list of updates") 862 try: 863 error_msg = output.split("Error: ")[1].replace("E:", "\n").strip() 864 if "apt.cache.FetchFailedException" in output and " changed its " in error_msg: 865 error_msg += "\n\n%s" % _("Run 'apt update' in a terminal window to address this") 866 except: 867 error_msg = "" 868 869 # Check presence of Mint layer 870 305.9 MiB 30.0 MiB 1 (mint_layer_found, error_msg) = self.check_policy() 871 305.9 MiB 0.0 MiB 1 if os.getenv("MINTUPDATE_TEST") == "layer-error" or (not mint_layer_found): 872 error_found = True 873 self.application.logger.write_error("Error: The APT policy is incorrect!") 874 875 label1 = _("Your APT configuration is corrupt.") 876 label2 = _("Do not install or update anything, it could break your operating system!") 877 label3 = _("To switch to a different Linux Mint mirror and solve this problem, click OK.") 878 879 msg = _("Your APT configuration is corrupt.") 880 if error_msg: 881 error_msg = "\n\n%s\n%s" % (_("APT error:"), error_msg) 882 else: 883 error_msg = "" 884 self.application.show_infobar(_("Please switch to another Linux Mint mirror"), 885 msg, Gtk.MessageType.ERROR, 886 callback=self._on_infobar_mintsources_response) 887 self.application.set_status(_("Could not refresh the list of updates"), 888 "%s\n%s" % (label1, label2), "mintupdate-error-symbolic", True) 889 self.application.builder.get_object("label_error_details").set_markup("%s\n%s\n%s%s" % (label1, label2, label3, error_msg)) 890 891 305.9 MiB 0.0 MiB 1 if error_found: 892 Gdk.threads_enter() 893 self.application.set_status(_("Could not refresh the list of updates"), 894 "%s%s%s" % (_("Could not refresh the list of updates"), "\n\n" if error_msg else "", error_msg), 895 "mintupdate-error-symbolic", True) 896 self.application.stack.set_visible_child_name("status_error") 897 self.application.builder.get_object("label_error_details").set_text(error_msg) 898 self.application.builder.get_object("label_error_details").show() 899 Gdk.threads_leave() 900 self.cleanup() 901 return False 902 903 # Look at the updates one by one 904 305.9 MiB 0.0 MiB 1 num_visible = 0 905 305.9 MiB 0.0 MiB 1 num_security = 0 906 305.9 MiB 0.0 MiB 1 num_software = 0 907 305.9 MiB 0.0 MiB 1 download_size = 0 908 305.9 MiB 0.0 MiB 1 is_self_update = False 909 306.3 MiB 0.4 MiB 1 tracker = UpdateTracker(self.application.settings, self.application.logger) 910 306.3 MiB 0.0 MiB 1 lines = output.split("---EOL---") 911 306.3 MiB 0.0 MiB 1 if len(lines): 912 306.6 MiB 0.0 MiB 2 for line in lines: 913 306.6 MiB 0.3 MiB 1 if not "###" in line: 914 306.6 MiB 0.0 MiB 1 continue 915 916 # Create update object 917 update = Update(package=None, input_string=line, source_name=None) 918 919 if tracker.active and update.type != "unstable": 920 tracker.update(update) 921 922 # Check if self-update is needed 923 if update.source_name in PRIORITY_UPDATES: 924 is_self_update = True 925 926 iter = model.insert_before(None, None) 927 model.row_changed(model.get_path(iter), iter) 928 929 model.set_value(iter, UPDATE_CHECKED, True) 930 download_size += update.size 931 932 shortdesc = update.short_description 933 if len(shortdesc) > 100: 934 try: 935 shortdesc = shortdesc[:100] 936 # Remove the last word.. in case we chomped 937 # a word containing an ê character.. 938 # if we ended up with &.. without the code and ; sign 939 # pango would fail to set the markup 940 words = shortdesc.split() 941 shortdesc = " ".join(words[:-1]) + "..." 942 except: 943 pass 944 945 if self.application.settings.get_boolean("show-descriptions"): 946 model.set_value(iter, UPDATE_DISPLAY_NAME, 947 "%s\n%s" % (GLib.markup_escape_text(update.display_name), GLib.markup_escape_text(shortdesc))) 948 else: 949 model.set_value(iter, UPDATE_DISPLAY_NAME, 950 "%s" % GLib.markup_escape_text(update.display_name)) 951 952 origin = update.origin 953 origin = origin.replace("linuxmint", "Linux Mint").replace("ubuntu", "Ubuntu").replace("LP-PPA-", "PPA ").replace("debian", "Debian") 954 955 type_sort_key = 0 # Used to sort by type 956 if update.type == "kernel": 957 tooltip = _("Kernel update") 958 type_sort_key = 2 959 num_security += 1 960 elif update.type == "security": 961 tooltip = _("Security update") 962 type_sort_key = 1 963 num_security += 1 964 elif update.type == "unstable": 965 tooltip = _("Unstable software. Only apply this update to help developers beta-test new software.") 966 type_sort_key = 7 967 else: 968 num_software += 1 969 if origin in ["Ubuntu", "Debian", "Linux Mint", "Canonical"]: 970 tooltip = _("Software update") 971 type_sort_key = 3 972 else: 973 update.type = "3rd-party" 974 tooltip = "%s\n%s" % (_("3rd-party update"), origin) 975 type_sort_key = 4 976 977 model.set_value(iter, UPDATE_OLD_VERSION, update.old_version) 978 model.set_value(iter, UPDATE_NEW_VERSION, update.new_version) 979 model.set_value(iter, UPDATE_SOURCE, "%s / %s" % (origin, update.archive)) 980 model.set_value(iter, UPDATE_SIZE, update.size) 981 model.set_value(iter, UPDATE_SIZE_STR, size_to_string(update.size)) 982 model.set_value(iter, UPDATE_TYPE_PIX, "mintupdate-type-%s-symbolic" % update.type) 983 model.set_value(iter, UPDATE_TYPE, update.type) 984 model.set_value(iter, UPDATE_TOOLTIP, tooltip) 985 model.set_value(iter, UPDATE_SORT_STR, "%s%s" % (str(type_sort_key), update.display_name)) 986 model.set_value(iter, UPDATE_OBJ, update) 987 num_visible += 1 988 989 306.6 MiB 0.0 MiB 1 if CINNAMON_SUPPORT and not is_self_update: 990 306.6 MiB 0.0 MiB 1 type_sort_key = 6 991 306.6 MiB 0.0 MiB 1 blacklist = self.application.settings.get_strv("blacklisted-packages") 992 993 306.8 MiB 0.3 MiB 1 for update in self.application.cinnamon_updater.get_updates(): 994 update.real_source_name = update.uuid 995 update.source_packages = ["%s=%s" % (update.uuid, update.new_version)] 996 update.package_names = [] 997 update.type = "cinnamon" 998 if update.uuid in blacklist or update.source_packages[0] in blacklist: 999 continue 1000 if update.spice_type == cinnamon.SPICE_TYPE_APPLET: 1001 tooltip = _("Cinnamon applet") 1002 elif update.spice_type == cinnamon.SPICE_TYPE_DESKLET: 1003 tooltip = _("Cinnamon desklet") 1004 elif update.spice_type == cinnamon.SPICE_TYPE_THEME: 1005 tooltip = _("Cinnamon theme") 1006 else: 1007 tooltip = _("Cinnamon extension") 1008 1009 if tracker.active: 1010 tracker.update(update) 1011 1012 iter = model.insert_before(None, None) 1013 model.row_changed(model.get_path(iter), iter) 1014 1015 model.set_value(iter, UPDATE_CHECKED, True) 1016 1017 if self.application.settings.get_boolean("show-descriptions"): 1018 model.set_value(iter, UPDATE_DISPLAY_NAME, "%s\n%s" % (GLib.markup_escape_text(update.uuid), 1019 GLib.markup_escape_text(update.name))) 1020 else: 1021 model.set_value(iter, UPDATE_DISPLAY_NAME, "%s" % GLib.markup_escape_text(update.uuid)) 1022 1023 model.set_value(iter, UPDATE_OLD_VERSION, update.old_version) 1024 model.set_value(iter, UPDATE_NEW_VERSION, update.new_version) 1025 model.set_value(iter, UPDATE_SOURCE, "Linux Mint / cinnamon") 1026 model.set_value(iter, UPDATE_SIZE, update.size) 1027 model.set_value(iter, UPDATE_SIZE_STR, size_to_string(update.size)) 1028 model.set_value(iter, UPDATE_TYPE_PIX, "cinnamon-symbolic") 1029 model.set_value(iter, UPDATE_TYPE, "cinnamon") 1030 model.set_value(iter, UPDATE_TOOLTIP, tooltip) 1031 model.set_value(iter, UPDATE_SORT_STR, "%s%s" % (str(type_sort_key), update.uuid)) 1032 model.set_value(iter, UPDATE_OBJ, update) 1033 num_software += 1 1034 num_visible += 1 1035 download_size += update.size 1036 1037 306.8 MiB 0.0 MiB 1 if FLATPAK_SUPPORT and self.application.flatpak_updater and not is_self_update: 1038 306.8 MiB 0.0 MiB 1 type_sort_key = 5 1039 306.8 MiB 0.0 MiB 1 blacklist = self.application.settings.get_strv("blacklisted-packages") 1040 1041 341.8 MiB 34.9 MiB 1 self.application.flatpak_updater.fetch_updates() 1042 345.4 MiB 3.6 MiB 1 if self.application.flatpak_updater.error == None: 1043 345.4 MiB 0.0 MiB 3 for update in self.application.flatpak_updater.updates: 1044 345.4 MiB 0.0 MiB 2 update.type = "flatpak" 1045 345.4 MiB 0.0 MiB 2 if update.ref_str in blacklist or update.source_packages[0] in blacklist: 1046 345.4 MiB 0.0 MiB 2 continue 1047 if update.flatpak_type == "app": 1048 tooltip = _("Flatpak application") 1049 else: 1050 tooltip = _("Flatpak runtime") 1051 1052 if tracker.active: 1053 tracker.update(update) 1054 1055 iter = model.insert_before(None, None) 1056 model.row_changed(model.get_path(iter), iter) 1057 1058 model.set_value(iter, UPDATE_CHECKED, True) 1059 1060 if self.application.settings.get_boolean("show-descriptions"): 1061 model.set_value(iter, UPDATE_DISPLAY_NAME, "%s\n%s" % (GLib.markup_escape_text(update.name), 1062 GLib.markup_escape_text(update.summary))) 1063 else: 1064 model.set_value(iter, UPDATE_DISPLAY_NAME, "%s" % GLib.markup_escape_text(update.name)) 1065 1066 model.set_value(iter, UPDATE_OLD_VERSION, update.old_version) 1067 model.set_value(iter, UPDATE_NEW_VERSION, update.new_version) 1068 model.set_value(iter, UPDATE_SOURCE, update.origin) 1069 model.set_value(iter, UPDATE_SIZE, update.size) 1070 model.set_value(iter, UPDATE_SIZE_STR, size_to_string(update.size)) 1071 model.set_value(iter, UPDATE_TYPE_PIX, "mintupdate-type-flatpak-symbolic") 1072 model.set_value(iter, UPDATE_TYPE, "flatpak") 1073 model.set_value(iter, UPDATE_TOOLTIP, tooltip) 1074 model.set_value(iter, UPDATE_SORT_STR, "%s%s" % (str(type_sort_key), update.ref_str)) 1075 model.set_value(iter, UPDATE_OBJ, update) 1076 num_software += 1 1077 num_visible += 1 1078 download_size += update.size 1079 1080 345.4 MiB 0.0 MiB 1 if tracker.active: 1081 if tracker.notify(): 1082 Gdk.threads_enter() 1083 notification_title = _("Updates are available") 1084 security_msg = gettext.ngettext("%d security update", "%d security updates", num_security) % num_security 1085 software_msg = gettext.ngettext("%d software update", "%d software updates", num_software) % num_software 1086 msg = "" 1087 if num_security > 0: 1088 msg = "%s\n" % security_msg 1089 if num_software > 0: 1090 msg = "%s%s\n" % (msg, software_msg) 1091 msg = "%s\n%s" % (msg, _("Apply them to keep your operating system safe and up to date.")) 1092 1093 # We use self.notification (instead of just a variable) to keep a memory pointer 1094 # on the notification. Without doing this, the callbacks are never executed by Gtk/Notify. 1095 self.notification = Notify.Notification.new(notification_title, msg, "mintupdate-updates-available-symbolic") 1096 self.notification.set_urgency(2) 1097 self.notification.set_timeout(Notify.EXPIRES_NEVER) 1098 self.notification.add_action("show_updates", _("View updates"), self.on_notification_action, None) 1099 self.notification.add_action("enable_automatic_updates", _("Enable automatic updates"), self.on_notification_action, None) 1100 self.notification.show() 1101 Gdk.threads_leave() 1102 tracker.record() 1103 1104 345.4 MiB 0.0 MiB 1 Gdk.threads_enter() 1105 # Updates found, update status message 1106 345.4 MiB 0.0 MiB 1 if num_visible > 0: 1107 self.application.logger.write("Found %d software updates" % num_visible) 1108 if is_self_update: 1109 self.application.stack.set_visible_child_name("status_self-update") 1110 self.application.statusbar.set_visible(False) 1111 status_string = "" 1112 else: 1113 status_string = gettext.ngettext("%(selected)d update selected (%(size)s)", 1114 "%(selected)d updates selected (%(size)s)", num_visible) % \ 1115 {'selected':num_visible, 'size':size_to_string(download_size)} 1116 self.application.builder.get_object("tool_clear").set_sensitive(True) 1117 self.application.builder.get_object("tool_select_all").set_sensitive(True) 1118 self.application.builder.get_object("tool_apply").set_sensitive(True) 1119 systray_tooltip = gettext.ngettext("%d update available", "%d updates available", num_visible) % num_visible 1120 self.application.set_status(status_string, systray_tooltip, "mintupdate-updates-available-symbolic", True) 1121 else: 1122 345.4 MiB 0.0 MiB 1 self.application.logger.write("System is up to date") 1123 345.4 MiB 0.0 MiB 1 self.application.stack.set_visible_child_name("status_updated") 1124 345.4 MiB 0.0 MiB 2 self.application.set_status("", _("Your system is up to date"), "mintupdate-up-to-date-symbolic", 1125 345.4 MiB 0.0 MiB 1 not self.application.settings.get_boolean("hide-systray")) 1126 1127 345.4 MiB 0.0 MiB 1 if FLATPAK_SUPPORT and self.application.flatpak_updater.error != None and not is_self_update: 1128 self.application.logger.write("Could not check for flatpak updates: %s" % self.application.flatpak_updater.error) 1129 msg = _("Error checking for flatpak updates: %s") % self.application.flatpak_updater.error 1130 self.application.set_status_message(msg) 1131 1132 345.4 MiB 0.0 MiB 1 self.application.builder.get_object("notebook_details").set_current_page(0) 1133 345.4 MiB 0.0 MiB 1 self.application.treeview.set_model(model) 1134 345.4 MiB 0.0 MiB 1 del model 1135 345.4 MiB 0.0 MiB 1 Gdk.threads_leave() 1136 1137 # Check whether to display the mirror infobar 1138 345.4 MiB 0.0 MiB 1 self.mirror_check() 1139 1140 345.4 MiB 0.0 MiB 1 self.application.logger.write("Refresh finished") 1141 except: 1142 print("-- Exception occurred in the refresh thread:\n%s" % traceback.format_exc()) 1143 self.application.logger.write_error("Exception occurred in the refresh thread: %s" % str(sys.exc_info()[0])) 1144 Gdk.threads_enter() 1145 self.application.set_status(_("Could not refresh the list of updates"), 1146 _("Could not refresh the list of updates"), "mintupdate-error-symbolic", True) 1147 Gdk.threads_leave() 1148 1149 finally: 1150 345.4 MiB 0.0 MiB 1 self.cleanup() Filename: /usr/lib/linuxmint/mintUpdate/flatpakUpdater.py Line # Mem usage Increment Occurrences Line Contents ============================================================= 116 90.770 MiB 90.770 MiB 1 @profile 117 def __init__(self): 118 90.969 MiB 0.199 MiB 1 self.installer = installer.Installer(installer.PKG_TYPE_FLATPAK) 119 92.617 MiB 1.648 MiB 1 self.fp_sys = _flatpak.get_fp_sys() 120 121 92.617 MiB 0.000 MiB 1 self.task = None 122 92.617 MiB 0.000 MiB 1 self.task_ready_event = threading.Event() 123 92.617 MiB 0.000 MiB 1 self.perform_updates_finished_event = threading.Event() 124 125 92.617 MiB 0.000 MiB 1 self.no_pull = True 126 127 92.617 MiB 0.000 MiB 1 self.updates = [] Filename: /usr/lib/linuxmint/mintUpdate/flatpakUpdater.py Line # Mem usage Increment Occurrences Line Contents ============================================================= 129 93.867 MiB 93.867 MiB 1 @profile 130 def refresh(self, full=True): 131 93.867 MiB 0.000 MiB 1 self.fp_sys.cleanup_local_refs_sync(None) 132 93.867 MiB 0.000 MiB 1 self.fp_sys.prune_local_repo(None) 133 134 147.324 MiB 53.457 MiB 1 if not self.installer.init_sync() or full: 135 self.installer.force_new_cache_sync() 136 self.installer.generate_uncached_pkginfos() 137 138 147.324 MiB 0.000 MiB 1 self.no_pull = False Filename: /usr/lib/linuxmint/mintUpdate/flatpakUpdater.py Line # Mem usage Increment Occurrences Line Contents ============================================================= 140 306.836 MiB 306.836 MiB 1 @profile 141 def fetch_updates(self): 142 306.836 MiB 0.000 MiB 1 print("Flatpak: generating updates") 143 332.645 MiB 25.809 MiB 1 _flatpak._initialize_appstream_thread() 144 145 332.645 MiB 0.000 MiB 1 self.updates = [] 146 332.645 MiB 0.000 MiB 1 self.task_ready_event.clear() 147 148 332.645 MiB 0.000 MiB 1 thread = threading.Thread(target=self._fetch_update_thread, name="mintupdate-flatpak-fetch-update-thread") 149 332.645 MiB 0.000 MiB 1 thread.start() 150 151 341.781 MiB 9.137 MiB 1 self.task_ready_event.wait(GET_UPDATES_TIMEOUT) 152 341.781 MiB 0.000 MiB 1 print("Flatpak: done generating updates") ```
kancolle386 commented 1 year ago

I have recievied mintUpdate 5.9.3 and tested it.

$ top -b -p80207 -e m -n 1
top - 09:13:32 up 1 day, 22:58,  1 user,  load average: 0.72, 0.77, 0.65
Tasks:   1 total,   0 running,   1 sleeping,   0 stopped,   0 zombie
%Cpu(s):  1.7 us,  0.8 sy,  0.0 ni, 97.5 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :  15923.0 total,   6475.0 free,   3457.2 used,   5990.8 buff/cache
MiB Swap:   2048.0 total,   2048.0 free,      0.0 used.  12086.1 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
  80207 kancoll+  20   0 1204.0m 499.1m  65.0m S   0.0   3.1   0:09.31 mintUpdate

$ top -b -p80207 -e m -n 1
top - 09:46:06 up 1 day, 23:31,  1 user,  load average: 0.32, 0.48, 0.76
Tasks:   1 total,   0 running,   1 sleeping,   0 stopped,   0 zombie
%Cpu(s):  1.6 us,  0.8 sy,  0.0 ni, 97.5 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :  15923.0 total,   5321.0 free,   4543.5 used,   6058.5 buff/cache
MiB Swap:   2048.0 total,   2048.0 free,      0.0 used.  10972.6 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
  80207 kancoll+  20   0 1293.9m 598.8m  65.4m S   0.0   3.8   0:19.39 mintUpdate

$ top -b -p80207 -e m -n 1
top - 09:47:11 up 1 day, 23:32,  1 user,  load average: 0.17, 0.40, 0.71
Tasks:   1 total,   0 running,   1 sleeping,   0 stopped,   0 zombie
%Cpu(s):  2.5 us,  0.0 sy,  0.0 ni, 97.5 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :  15923.0 total,   5293.3 free,   4566.6 used,   6063.1 buff/cache
MiB Swap:   2048.0 total,   2048.0 free,      0.0 used.  10947.1 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
  80207 kancoll+  20   0 1294.9m 636.9m  65.4m S   0.0   4.0   0:22.78 mintUpdate
clefebvre commented 1 year ago

Fixed in mintupdate 5.9.4