-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Closed
Description
If you execute the following code, you'll it leaks a reference to the array:
recordtype = np.dtype([('a', np.float64), ('b', np.int32), ('d', (np.str, 5))])
a = np.zeros(2, dtype=recordtype)
print(sys.getrefcount(a))
u, v = a[0], a[1]
u == v
del u, v
gc.collect()
print(sys.getrefcount(a))
The leak disappears if you remove the comparison (u == v
) or if you remove the character string member in the dtype (the d
member here). I've tried to diagnose this but I'm ending up completely lost in the comparison logic (which creates multiple temporary arrays).
Metadata
Metadata
Assignees
Labels
No labels