dic1.update(dic2)和{**dic2, **dic1}的区别

dic.update容易造成垃圾无法回收

例如

1

self.all_customer_dic.update(all_customer_dic)

del all_customer_dic
gc.collect()

依然占用1.55GB

但是使用
2、
self.all_customer_dic = {**all_customer_dic, **self.all_customer_dic} #尽量不要使用dic.update容易造成内存泄漏

新增商户之后内存1.1GB
不会出现垃圾未回收的情况

3、
如果直接重启
占用内存1.03 GB