Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

index does not release memory #5859

Open
parihaaraka opened this issue Mar 1, 2021 · 2 comments
Open

index does not release memory #5859

parihaaraka opened this issue Mar 1, 2021 · 2 comments
Labels
feature A new functionality
Milestone

Comments

@parihaaraka
Copy link

Tarantool 2.6.2-0-g34d504d7d

do
    local s = box.schema.space.create('test', {format = {{'id', 'unsigned'}}, temporary = true})
    local pk = s:create_index('pk', {parts = {'id'}})
    -- peak load
    for i = 1, 500000 do
        s:insert({i})
    end
    -- wipe outdated records after some time
    for i = 1, 499000 do
        s:delete(i)
    end

    local res = string.format('space size: %d kb, index size: %d kb',
        tonumber(s:bsize() / 1024),
        tonumber(pk:bsize() / 1024)
    )
    s:drop()
    return res
end

space size: 5 kb, index size: 11040 kb

@parihaaraka parihaaraka added the bug Something isn't working label Mar 1, 2021
@Korablev77
Copy link
Contributor

Korablev77 commented Mar 1, 2021

It's not a bug. See #4780

I would say it's not a bug but known behavior. Any index does not free any memory; it stays reserved for further insertions. This approach not only makes implementation easier but have some performance advantages as well. I'm not sure we'll change it anytime soon.

Probably we should document this behaviour.

@parihaaraka
Copy link
Author

..and propose some kind of index:vacuum()

@kyukhin kyukhin added feature A new functionality and removed bug Something isn't working labels Jul 13, 2021
@kyukhin kyukhin added this to the wishlist milestone Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality
Projects
None yet
Development

No branches or pull requests

3 participants