GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — eruby filetype plugin leaks memory · Issue #431 · vim-ruby/vim-ruby

eruby filetype plugin leaks memory #431

New issue
Copy link
New issue
Copy link
Closed
Closed
eruby filetype plugin leaks memory#431
Copy link

Description

@dunrix
dunrix
opened on Jun 11, 2021
Issue body actions

Invoking filetype detection on eruby buffer results in memory leaking.

Way to reproduce:

  1. open an eruby file in vim buffer, like test.erb with following contents
<!DOCTYPE html>
<html>
  <body>
  </body>
</html>
  1. make sure filetype plugin is enabled
    filetype plugin on
  2. check vim process resident memory size. Around 21 MB in my case.
  3. invoke filetype detect command many times to observe memory grow. I did it with
:for i in range(20)
:  filetype detect
:endfor
  1. check vim process memory again to see the leak. ~ 1.1 GB in my case.

Additional notes:

  • it leaks only when filetype plugin is on. It may be related to filetype detect behavior, quoting from vim docs for filetype-detect:

When filetype detection was off, it will be enabled first, like the "on"
argument was used.

  • it does not leak in case of other file types like ruby, python, html. Observed only at eruby.
  • Vim 8.2.2891 on x86_64 Linux
  • eruby ftplugin - last change 2019 Jan 06

I'm sorry for previous x-report on vim-rails. Now I've been finally able to narrow-down environment state at which reported issue reliably occurs.

Activity

  1. tpope commented on Jun 11, 2021

    @tpope
    tpope
    on Jun 11, 2021
    Member
    More actions

    Unlike with rails.vim, this should be easy enough to narrow down yourself. Start deleting stuff from the bottom of ftplugin/eruby.vim and keep going until the issue goes away. Just make sure you keep let b:did_ftplugin = 1 so that another version of the ftplugin doesn't load.

  2. dunrix commented on Jun 12, 2021

    @dunrix
    dunrix
    on Jun 12, 2021
    Author
    More actions

    Ok, that was fast, although I'm not learned in vimscript.

    The cause of leak was improperly set b:undo_ftplugin for unloading stuff, by omitting concatenation operator.

    Found out this bug was already fixed year ago in your repo, however Vim upstream is still out of sync.

    Vim issue reporting policy suggests contact authors directly in case of plugins. That's why I came here… 😕

  3. tpope commented on Jun 12, 2021

    @tpope
    tpope
    on Jun 12, 2021
    Member
    More actions

    I remember this bug, but didn't realize it had the potential for an explosive memory leak. We might wanna do the next upstream sync sooner rather than later.

  4. tpope
    closed this as completedon Jun 12, 2021
  5. dkearns commented on Jun 13, 2021

    @dkearns
    dkearns
    on Jun 13, 2021
    Member
    More actions

    Yes, I'll update Bram today.

    Reacted by Tim Pope and Noa Bogart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.