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 / Solver freezing #44

Closed
ghost opened this issue Jun 1, 2016 · 5 comments
Closed

Memory leak / Solver freezing #44

ghost opened this issue Jun 1, 2016 · 5 comments

Comments

@ghost
Copy link

ghost commented Jun 1, 2016

It's odd. I can't tell if this is a memory leak issue or a solver issue. It appears that enabling Ints for these variables causes the solver to slip into an infinite loop.

Other times, if the constraints are a little different, it will solve it within 4 seconds; however, if I run again, it will go into an infinite loop (or so it appears).

Below is the JSON-stringify version of the model:

{"optimize":"totalCost","opType":"max","variables":{"Tanks":{"Dollers":95,"Goats":75,"Land":40,"Air":40,"totalCost":210},"Aircrafts":{"Dollers":145,"Goats":70,"Land":85,"Air":40,"totalCost":300},"Cars":{"Dollers":130,"Goats":120,"Land":170,"Air":70,"totalCost":420},"Horses":{"Dollers":370,"Goats":270,"Land":290,"Air":75,"totalCost":930},"Motorcycles":{"Dollers":450,"Goats":515,"Land":480,"Air":80,"totalCost":1445},"Dogs":{"Dollers":1000,"Goats":300,"Land":350,"Air":70,"totalCost":1650}},"constraints":{"Dollers":{"max":39599},"Goats":{"max":37025},"Land":{"max":38234},"Air":{"max":66400}},"ints":{"Tanks":1,"Aircrafts":1,"Cars":1,"Horses":1,"Motorcycles":1,"Dogs":1}}

@ghost
Copy link
Author

ghost commented Jun 1, 2016

And other addition, it looks like it is more of an issue when the constraints are large (35k+). When they're low (<=20k), then all works fine, and it's relatively quick.

I'm using master version btw.

@lvenerosy
Copy link
Contributor

Hi, I am not sure I understand about this point :

Other times, if the constraints are a little different, it will solve it within 4 seconds; however, if I run again, it will go into an infinite loop (or so it appears).

Does the same model gives different runtime behaviours from one execution to another ? Since the solver is deterministic it would be really puzzling.

Concerning your JSON model I get this result :

in 5.775604776 s
11609 'iterations'
feasible? true
result? 114850
{ Motorcycles: 44, Cars: 63, Aircrafts: 52, Tanks: 35, Horses: 2 }

If you have a model that you think fell into an infinite loop I'd be glad to examine it.

@ghost
Copy link
Author

ghost commented Jun 2, 2016

Thanks for the reply!

This is the exact model that falls into the infinite loop. If I try to run it again, it will take > 5 mins, again will much longer. I'm doing this in Chrome, if that helps.

@lvenerosy
Copy link
Contributor

I created a node server then I loaded the JSON and solved the model in an HTML file that I launched in Chrome :

solving: 6648.551ms
11609 "iterations"
feasible? true
result? 114850
Object {Motorcycles: 44, Cars: 63, Aircrafts: 52, Tanks: 35, Horses: 2}

Could you give me the files necessary to recreate your problem ?

@ghost
Copy link
Author

ghost commented Jun 3, 2016

It's odd, but I cannot reproduce the issue now. Perhaps there was a browser bug that it stumbled upon. Thanks for your responses! Amazing work too!

@ghost ghost closed this as completed Jun 3, 2016
This issue was closed.
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

1 participant