[vim/vim] Virtual text properties consume ever increasing memory as they are added/deleted. (Issue #19681)

1 view
Skip to first unread message

Paul Ollis

unread,
Mar 14, 2026, 11:04:47 AMMar 14
to vim/vim, Subscribed
paul-ollis created an issue (vim/vim#19681)

Steps to reproduce

Run the following vim script. You will need to use Ctrl-C to stop it.

new

call prop_type_add('comment', {'highlight': 'Directory'})

call setline(1, ['one', 'two', ''])

let id_a = prop_add(1, 0, {'type': 'comment', 'text': '<text-a>'})
let id_b = prop_add(2, 0, {'type': 'comment', 'text': '<text-b>'})

let n = 0
while n < 10000

    let k = 0
    while k < 10000
        call prop_remove({'type': 'comment'}, 1)
        let id_a = prop_add(1, 0, {'type': 'comment', 'text': '<text-a>'})
        call prop_remove({'type': 'comment'}, 2)
        let id_b = prop_add(2, 0, {'type': 'comment', 'text': '<text-b>'})
        let k += 1
    endwhile

    call setline(3, printf('id_a=%d id_b=%d', id_a, id_b))
    let n += 1
    sleep 10m
    redraw
endwhile

Expected behaviour

The memory use should be stable, but memory use increases over time.

Note that the underlying data structure in Vim increases by doubling in size,
so over time jumps in memory use become less frequent, but larger.

The above example is contrived, but perfectly legitimate plug-in code could
cause this. I suspect I have seen this occurring while investigating a different
issue.

Version of Vim

9.2.112

Environment

OS = LinuxMint 21.1
terminal = Terminator /
$TERM = xterm-256color
shell = Xonsh / Bash

Logs and stack traces


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19681@github.com>

Christian Brabandt

unread,
4:51 PM (5 hours ago) 4:51 PM
to vim/vim, Subscribed

Closed #19681 as completed via ff41e9d.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/19681/issue_event/24273309521@github.com>

Reply all
Reply to author
Forward
0 new messages