sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
809 stars 39 forks source link

Using too much memory after disabling/enabling packages at start up on Linux #2775

Closed evandrocoan closed 5 years ago

evandrocoan commented 5 years ago

Description

https://github.com/SublimeTextIssues/Core/issues/2724#issuecomment-479156507 Well, you've just reenabled 150ish(?)

Windows do not leak anything, while Linux does a lot.

Steps to reproduce

You can make Sublime Text bleed memory (Linux Only) at start up by:

  1. Dowload the binary file: sublime-text-3.zip (60MB)
  2. Install the packages on the file sublime-text-3.zip (60MB)
  3. Open Sublime Text and wait it load all packages
  4. Close Sublime Text
  5. Using another text editor, open the file User/Preferences.sublime-settings and add all installed third part packages to the ignored_packages setting. For your convenience, here bellow, there is a list with every single one of them:
    { "ignored_packages": [ "A File Icon", "AceJump", "ActiveViewJumpBack", "AddFolderToProject", "AdvancedCSV", "Alignment", "AlignTab", "AllAutocomplete", "AltUp", "AmxxEditor", "AmxxPawn", "ANSIescape", "AutoHotkey", "AutomaticPackageReloader", "AutoRefresh", "AutoWrap", "BBCode", "BeautifyJavaScript", "Better OCaml", "BetterCoffeeScript", "BetterFindBuffer", "BracketHighlighter", "BufferScroll", "BuildView", "CaseConversion", "ChainOfCommand", "ChangeQuotes", "ChannelRepositoryTools", "ClearCursorsCarets", "ClickableURLs", "ClipboardScopeCopy", "Color Highlighter", "ColorSchemeEditor", "ColorSchemeUnit", "ColumnSelect", "ConvertToUTF8", "CopyWithLineNumbersReloaded", "DefaultSyntax", "DeleteCurrentFile", "DistractionFreeWindow", "DocBlockr", "Dotfiles", "DuplicateSelections", "EditPreferences", "Emmet", "EvaluateInlinePython", "EvaluatePrinter", "EvaluateShell", "ExpandRegion", "ExportHtml", "ExtendedTabSwitcher", "ExtractText", "File Rename", "FileDiffs", "FileHistory", "FileRename", "FindKeyConflicts", "FixProjectSwitchRestartBug", "FixSelectionAfterIndent", "ForceRewriteSublimeSettings", "FuzzyFileNav", "GenericConfig", "GitHubMarkdownSnippets", "Glue", "GoogleSpellCheck", "HexViewer", "HighlightBuildErrors", "HighlightWords", "HighlightWordsOnSelection", "HorizontalScroll", "HungryBackspace", "Incrementor", "IncrementSelection", "IndentAndBraces", "IndentSize", "Insert Nums", "InsertNums", "InvertSelection", "JSCustom", "JumpAlongIndent", "KeepPastedTextSelected", "Language - English and Portuguese", "LanguageTool", "LaTeXSmartQuotes", "LaTeXTools", "LaTeXWordCount", "LESS", "LineEndingsUnify", "LinesMultisets", "LocalHistory", "LSP", "MarkdownPreview", "MarkdownToBBCode", "Maven", "MaxPane", "MoveText", "MultiEditUtils", "Notepad++ Color Scheme", "NumberKing", "Octave", "OpenAutoCompletion", "Origami", "OverrideAudit", "OverrideCommitCompletion", "OverrideUnpackedPackages", "PackageDev", "PackageResourceViewer", "PackagesManager", "PanelManager", "PathTranslator", "PlantUmlDiagrams", "PostScript", "PowerCursors", "PowerShell", "PrettyJSON", "PushdownParserSyntax", "PyV8", "QuickSettings", "RandomEverything", "REG", "ReIndent", "RememberCommandPaletteInput", "RemoveNonAsciiChars", "RichPlainText", "Rust Enhanced", "SassSyntax", "ScopeHunter", "SelectAll", "SelectAllSpellingErrors", "SelectUntil", "SemanticLineWrap", "SideBarEnhancements", "SideBySideCompare", "SideBySideSettings", "SQLExec", "SQLKeywordUppercase", "SQLTools", "StickySearch", "StudioChannel", "SublimeLinter", "SublimeTutorial", "Swift", "SyncViewScroll", "SyntaxManager", "TabsExtra", "TerminalShortcuts", "Terminus", "TestPlier", "TextPastry", "ToggleWords", "TOML", "Trimmer", "TypeScript", "UnitTesting", "VBScript", "ViewSettingsFreely", "Whitespace", "WordCount", "WrapPlus", "X86Assembly", "zzz A File Icon zzz", "ZzzReloadDefaultPackage", "Vintage", ] }
  6. Now open Sublime Text, and right from the beginning, it will be using 500MB of RAM memory on build 3176 and 238MB on build 3200.
  7. But, the reverse is worse. If now, you close Sublime Text and set back { "ignored_packages": [ "Vintage" ] }
  8. The next time you open Sublime Text, it will be using 860MB of RAM memory right from the start on build 3176 and 1.1GB on build 3200.
  9. And finally, if you just restart Sublime Text more one time, without touching User/Preferences.sublime-settings, it will be using only 40MB of RAM memory right from the start on build 3176 and 80MB on build 3200.
  10. All of this is only reproducible on Linux. Doing these steps on Windows, shows no problems with memory usage at all, other than just few loose mega bytes in the end of the process.

Expected behavior

No memory heavy leak when using Sublime Text on Linux.

Actual behavior

Memory heavy leak when using Sublime Text on Linux.

Environment

  1. Linux

    • Build: 3200 x64
    • Operating system and version: Linux Mint 19.1 XFCE4 x64 - Kernel 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
    • [Linux] Desktop Environment and/or Window Manager: XFCE4 -> Xfwm4 + Compositing
  2. Windows

    • Operating system and version:
      • Windows 10 build 15063 x64
      • Mac OS ...
      • Linux ...
    • Monitor:
      • Resolution 1920x1080
      • dpi_scale used in ST 1.0
    • Sublime Text:
      • Build 31200
      • 64 bit
wbond commented 5 years ago

Keep your testing to a single OS. Trying to compare across OSes is unlikely to be helpful. There are so many different things.