Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
237 views
in Technique[技术] by (71.8m points)

macos - Extreme lag while developing using Mac OS

Im working on Mac Book Pro, OS : Catalina 10.15.7.

At first I was using VS Code to develop in Go but the ( fan?? ) i guess started sounding like a turbo Jet after a while up to the point that the entire OS would shutdown on its own. ( I do not exactly recall what the message said, it was a black screen with white text saying something like your cpu utilization was too high etc, etc and we had to restart the system ).

Today I am trying to run this Python3 script :

#!/usr/local/bin/python3

import csv
import json
import boto3
import time
from multiprocessing import Pool


dynamodb = boto3.resource('dynamodb', endpoint_url='http://localhost:4566', region_name='us-east-2')
table = dynamodb.Table('myTable')

collection  = []
count = 0
with open('items.csv', newline='') as f:
    reader = csv.DictReader(f)
    for row in reader:
        obj = {}
        collection.append({
            "PK" : int(row['id']),
            "SK" : "product",
            "Name" : row['name']
        })

def InsertItem(i):
    table.put_item(Item=i)

if __name__ == '__main__':

    with Pool(processes=25) as pool:
            result = pool.map(InsertItem, collection, 50)

    print(result)

And the same behavior occurs ( it does not seem to be related to VS Code now since im directly running this script from the terminal ), the fans are extremely noisy, the performance drops to almost 0 and i get the lollypop mouse pointer of death. ( which seems to be an omen of the PC about to restart itself ) and the process I mentioned above happens again.

Some hints of what is going on :

  1. Im not the only one having this problem. Another teammate does React and is seeing the same behaviour. ( Hs is using VsCode too but I think the problem is more generic ).
  2. It seems to appear only with "intensive" tasks. ( And please take "intensive" with a grain of salt. I do the very same tasks in my Ubuntu Machine with half the RAM and it does not even flinch ).
  3. I have been using Mac for years, and I do not recall having this issue.

So, my question is, is someone else noticing something similar? Is there some workaround for this?

Last note: The python script you see above I tested last week, it did not take even 2 minutes to run. today with these issues its just lingers forever. And I can see for the prints I am doing that it attempts to insert stuff but it freezes without moving forward.

question from:https://stackoverflow.com/questions/65602062/extreme-lag-while-developing-using-mac-os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...