参考python垃圾回收规则,全局变量在其模块被导入后,将一直存在于内存当中。 参考: https://zhuanlan.zhihu.com/p/59636541 http://www.voidcn.com/article/p-wjtzwolh-bwk.html