python中具有不同runtim的迭代子进程

2024-05-13 08:00:45 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在写一个python脚本,而不是运行x次迭代。在每次迭代中,我启动一个子进程来调用java进程。奇怪的是,我的java进程的cpu运行时差别很大,在迭代y时,我得到了一条java失败消息,表明java堆的大小被超过了。你知道吗

p=subprocess.Popen([cmd], stdout=subprocess.PIPE, shell=True)                                     
    (output,errput)=p.communicate() #waits until the process is terminated          
    return output

Tags: 脚本cmdtrue消息output进程stdoutjava