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

Ubuntu 22.04 Python 3.10 Memory Surge for Solver #3857

Open
poirot-19 opened this issue Jul 15, 2023 · 3 comments
Open

Ubuntu 22.04 Python 3.10 Memory Surge for Solver #3857

poirot-19 opened this issue Jul 15, 2023 · 3 comments
Assignees
Labels
Feature Request Missing Feature/Wrapper Help Needed Modeling/Usage problem Lang: Python Python wrapper issue Solver: Routing Uses the Routing library and the original CP solver
Milestone

Comments

@poirot-19
Copy link

poirot-19 commented Jul 15, 2023

Version: 9.6.2534
Language: Python

Solver - Routing Solver
OS - Ubuntu 22.04

Steps to reproduce the behavior:

def solve(self):
        search_parameters = pywrapcp.DefaultRoutingSearchParameters()
        search_parameters.time_limit.seconds = {
                                                                                     "max": 120,
                                                                                      "min": 5,
                                                                                      "ratio": 1
                                                                                        }
        search_parameters.first_solution_strategy = 'AUTOMATIC'
        if self.routing_options['local_search_metaheuristic']:
            search_parameters.local_search_metaheuristic = 'GUIDED_LOCAL_SEARCH`
        search_parameters.log_search = true
        search_parameters.use_cp_sat = false
        return self.get_solution(self.routing_model.SolveWithParameters(search_parameters))

Before this I have created the Routing Model object
What did you expect to see
Routes getting created

What did you see instead?
Huge memory surge from 120 MB -> 1.6 GB and continuously increasing leading to restart of Docker container.

I am running the same code on Ubuntu 20.04 with Python 3.8, its working perfectly fine
Another observation is that if I add @Profile (memory_profiler) decorator to Solve function then it works fine.

Error Message below

WARNING: All log messages before absl::InitializeLog() is called are written to STDERR

I0000 00:00:1689454096.761452      15 routing.cc:3379] All Unperformed Solution (5980000000, time = 70 ms, memory used = 353.11 MB)

I0000 00:00:1689454096.762653      15 search.cc:265] Start search (memory used = 353.11 MB)

I0000 00:00:1689454096.774135      15 search.cc:265] Root node processed (time = 11 ms, constraints = 6279, memory used = 353.15 MB)

[2023-07-15 20:48:34,789: ERROR/MainProcess] Process 'ForkPoolWorker-1' pid:15 exited with 'signal 9 (SIGKILL)'

[2023-07-15 20:48:34] [ERROR] [f:request.py] [l:544] [n:celery.worker.request] Task handler raised error: WorkerLostError('Worker exited prematurely: signal 9 (SIGKILL).')

Traceback (most recent call last):

  File "/usr/local/lib/python3.10/dist-packages/billiard/pool.py", line 1265, in mark_as_worker_lost

    raise WorkerLostError(

billiard.exceptions.WorkerLostError: Worker exited prematurely: signal 9 (SIGKILL).

Make sure you include information that can help us debug (full error message, model Proto).
Anything else we should know about your project / environment
Its solving the VRP problem with around 400 tasks.

If you need exact steps to reproduce, please let me know, i will try to add more details

@Mizux Mizux self-assigned this Jul 15, 2023
@Mizux Mizux added Feature Request Missing Feature/Wrapper Help Needed Modeling/Usage problem Lang: Python Python wrapper issue Solver: Routing Uses the Routing library and the original CP solver labels Jul 15, 2023
@Mizux Mizux added this to the v9.8 milestone Jul 15, 2023
@lperron
Copy link
Collaborator

lperron commented Jul 16, 2023

Not sure it has anything to do with the routing library. Seems like a gc/memory allocation problem in the docker library.

@poirot-19
Copy link
Author

@lperron same thing is happening when running on GCP Ubuntu VM 22.04 and Python 3.10. When the same application code runs on Ubuntu 20.04 and Python 3.8, it works perfectly fine. Do you think Solver has some issues on Ubuntu 22.04

@lperron
Copy link
Collaborator

lperron commented Jul 16, 2023 via email

@Mizux Mizux modified the milestones: v9.8, v9.9 Oct 13, 2023
@Mizux Mizux modified the milestones: v9.9, v10.0 Feb 12, 2024
@Mizux Mizux modified the milestones: v10.0, Backlog Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Missing Feature/Wrapper Help Needed Modeling/Usage problem Lang: Python Python wrapper issue Solver: Routing Uses the Routing library and the original CP solver
3 participants