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

Memory leak while reading from sparse arrays #859

Open
danielgafni opened this issue Dec 27, 2021 · 4 comments
Open

Memory leak while reading from sparse arrays #859

danielgafni opened this issue Dec 27, 2021 · 4 comments

Comments

@danielgafni
Copy link

danielgafni commented Dec 27, 2021

Bug

A snippet to reproduce (you can monitor the consumed memory in any convenient way, like htop):

import tiledb
import numpy as np

users = np.arange(1000000)
items = np.arange(1000000)
labels = np.random.randint(0, 2, 1000000)

dom = tiledb.Domain(
    tiledb.Dim(name="user", domain=(0, users.max()), tile=4, dtype=np.int32),
    tiledb.Dim(name="item", domain=(0, items.max()), tile=4, dtype=np.int32),
)

schema = tiledb.ArraySchema(domain=dom, sparse=True, attrs=(tiledb.Attr(name="label", dtype=np.int8),))

tiledb.SparseArray.create("array.tiledb", schema)

with tiledb.open("array.tiledb", mode="w") as arr:
    arr[users, items] = labels
    
arr = tiledb.open("array.tiledb")

while True:
    arr[0]

Info

OS
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"

Python 3.7.12
tiledb 0.11.5
numpy 1.21.4

@ihnorton
Copy link
Member

Hi @danielgafni, thanks for trying TileDB and for opening the issue. We do have several tests for memory usage, although this may be too slow to show up in that case. We'll take a closer look and get back to you soon. Thanks!

@danielgafni
Copy link
Author

Hey guys! Any progress with this?

@ihnorton
Copy link
Member

ihnorton commented Jan 18, 2022

Hi @danielgafni, I've put in two fixes which will be in the next libtiledb/tiledb-py release:

Thanks again for the report!

@danielgafni
Copy link
Author

Thank you @ihnorton !

Can't wait to try the fixed version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants