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

Suspected memory leakage in highspy (python = 3.10) #2080

Open
yokawhhh opened this issue Dec 11, 2024 · 4 comments
Open

Suspected memory leakage in highspy (python = 3.10) #2080

yokawhhh opened this issue Dec 11, 2024 · 4 comments
Assignees

Comments

@yokawhhh
Copy link

As I solved a large mip model on more datasets on a jupyter notebook on my wsl on windows, the memory it used increased. At last, the task will fail because it used up the memory(8G). But if I run the notebook one by one and each one just solve one dataset, it can work successfully.

I guess the memory won't be completely cleared up when a model ends its solving.

If u need more correspoding information, u can tell me how to get them.

@jajhall
Copy link
Member

jajhall commented Dec 11, 2024

What version of HiGHS are you using?

@yokawhhh
Copy link
Author

highspy 1.8.1

@galabovaa
Copy link
Contributor

Would you be able to share your notebook and data? This way I can try to reproduce the behaviour locally on my windows with wsl.

@yokawhhh
Copy link
Author

yokawhhh commented Jan 8, 2025

sorry for reply now for I being seriously ill recently. I have done another experient. In one notebook, I continuely run following function for solving nqueens for 40 times, the memory usage improves 1GB. And the memory used by the function should be freed after its calling.

def nqueens(N):
    h = highspy.Highs()
    h.silent()
    x = h.addBinaries(N, N)
    h.addConstrs(x.sum(axis=0) == 1)    # each row has exactly one queen
    h.addConstrs(x.sum(axis=1) == 1)    # each col has exactly one queen
    y = np.fliplr(x)
    h.addConstrs(x.diagonal(k).sum() <= 1 for k in range(-N + 1, N))   # each diagonal has at most one queen
    h.addConstrs(y.diagonal(k).sum() <= 1 for k in range(-N + 1, N))   # each 'reverse' diagonal has at most one queen
    h.solve()
    sol = h.vals(x)

image

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

No branches or pull requests

3 participants