Skip to content

eruby filetype plugin leaks memory #431

@dunrix

Description

@dunrix

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.

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