# Help! Ray 2.0.0 on Windows 10 runs slower and slower and then hangs

**URL:** <https://discuss.ray.io/t/help-ray-2-0-0-on-windows-10-runs-slower-and-slower-and-then-hangs/7427>\
**Category:** Ray Core\
**Created:** [September 4, 2022, 5:28pm UTC](https://discuss.ray.io/t/help-ray-2-0-0-on-windows-10-runs-slower-and-slower-and-then-hangs/7427 "2022-09-04T17:28:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Dwell\_Siegmund](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/mike_dwell_siegmund/32/1981_2.png) [@Mike\_Dwell\_Siegmund](https://discuss.ray.io/u/Mike_Dwell_Siegmund)\
**Post date:** [September 4, 2022, 5:28pm UTC](https://discuss.ray.io/t/help-ray-2-0-0-on-windows-10-runs-slower-and-slower-and-then-hangs/7427/1 "2022-09-04T17:28:49Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- High: It blocks me to complete my task.

OS: Win 10  
CPU: AMD 64-Core  
Memory: 128GB  
Env: Anaconda (the latest version). “base” env  
Python: 3.9.12  
Ray: 2.0.0 for cp39. I installed via downloading the whl version and then pip install.  
Harddrive: both C and D drives has more than 128GB available.

I kept the num\_cpus small. And I also made sure (by eye-watching) at any time the Windows task manager resource viewer’s Memory Usage is \< 50%.

My code snippet:

NUM\_WORKERS = multiprocessing.cpu\_count()

ray.init(num\_cpus=20)#NUM\_WORKERS)

# all the huge\_arrays are numpy arrays. And they total around 15-20GB.

objref1 = ray.put(huge\_array1)  
objref2 = ray.put(huge\_array2)  
objref3 = ray.put(huge\_array3)  
objref4 = ray.put(huge\_array4)

futures =

for i in range(10000):  
futures.append(process\_one\_point\_at\_a\_time.remote(i, objref1, objref2, objref3, objref4 ))

results = ray.get(futures)

* * *

Observations:

1. Without any error, it runs slower and slower and eventually reached freezing mode when i increases to 1000. At that time, the Windows Task Manager resource viewer shows CPU usage is around 20% and memory usage is around 30%.

2. Inside the loop, there is Scikit-Learn training function, which has a parallel mechanism itself(multithreading?), in which I assigned n\_jobs = 40 to it.  
So my estimation was: Ray uses num\_cpus=20, and Scikit-Learn training uses n\_jobs=40, together they sum to 60, which is less than 64.

3. I have timed it and found that one iteration executes around 70 seconds. So initially Ray runs very fast with issuing 20 task in parallel. And then it gets slower and slower, and finally it freezes at 1000.

It seems that Ray does not allow dispatching all 10000 tasks all at the same time?

It looks it might be better to send out jobs in batches, for example, every 100 jobs in one batch?

Because the job stalled, now it is even worse than single process, which defeats the initial goal of using Ray, I am beating my head against wall.

Please help me and shed some lights on me!

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Stephanie\_Wang](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/stephanie_wang/32/18_2.png) [@Stephanie\_Wang](https://discuss.ray.io/u/Stephanie_Wang)\
**Post date:** [September 7, 2022, 4:34am UTC](https://discuss.ray.io/t/help-ray-2-0-0-on-windows-10-runs-slower-and-slower-and-then-hangs/7427/2 "2022-09-07T04:34:04Z")

</div>

Thanks for the info! It should not be a problem to run 10k tasks (or more) at a time. I tried running a version of your script that uses an empty `process_one_point_at_a_time`, but I did not see the same issue, so it may be something to do with what’s happening inside your function.

Can you say a bit more about the remote function? It would be even better if you could provide the code directly. Thanks!
