Skip to content

Commit d21124f

Browse files
author
woytu
committed
fixed 改变清除内存策略
1 parent 112b5c8 commit d21124f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

utils/SystemUtil.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,16 @@ def restart_process(path):
146146
# if gc.isenabled():
147147
# # 释放内存
148148
# gc.collect()
149-
print("前进程id:", os.getpid(), "父进程id:", os.getppid())
149+
print("当前进程id:", os.getpid())
150+
print("前进程组id:", os.getpid())
151+
print("父进程id:", os.getppid())
150152

151153
py = "python3" if (os.system("python3 -V") == 0) else "python"
152154
sysstr = platform.system()
153155
if sysstr == "Windows":
154-
os.system(f"taskkill /pid {os.getpgid()} /f && {py} {path}")
156+
os.system(f"taskkill /pid {os.getpid()} /f && {py} {path}")
155157
elif sysstr == "Linux":
156-
os.system(f"kill -9 {os.getpgid()} && {py} {path}")
158+
os.system(f"kill -9 {os.getpid()} && {py} {path}")
157159

158160

159161
if __name__ == '__main__':

0 commit comments

Comments
 (0)