Description
When QUBOs are created repeatedly, memory usage increases linearly and is not released until the process terminates.
This behavior occurs in versions 1.3 and 1.4 , but not in 1.2.
To Reproduce
Run below script with version 1.3.0 or higher
import pyqubo
def create_qubo():
x = pyqubo.Array.create("x", 100, 'BINARY')
constraint = (sum(x) - 1) ** 2
model = constraint.compile()
qubo, offset = model.to_qubo()
return qubo, offset
if __name__ == '__main__':
n_iter = 1000
for i in range(n_iter):
qubo, offset = create_qubo()
Description When QUBOs are created repeatedly, memory usage increases linearly and is not released until the process terminates. This behavior occurs in versions 1.3 and 1.4 , but not in 1.2.
To Reproduce Run below script with version 1.3.0 or higher