mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-15 04:52:31 +08:00
caching: RAMPressure: Remove gc.collect()
This is too expensive to run when the cache is in bankrupcy. Cache none has the same problems and if we are the last ref into cycling gargbage we need to fix it at source. The standard periodic gc is still in play.
This commit is contained in:
parent
2690e64696
commit
403cb471a4
@ -528,8 +528,6 @@ class RAMPressureCache(LRUCache):
|
|||||||
if psutil.virtual_memory().available >= target:
|
if psutil.virtual_memory().available >= target:
|
||||||
return
|
return
|
||||||
|
|
||||||
gc.collect()
|
|
||||||
|
|
||||||
clean_list = []
|
clean_list = []
|
||||||
|
|
||||||
for key, cache_entry in self.cache.items():
|
for key, cache_entry in self.cache.items():
|
||||||
@ -558,4 +556,3 @@ class RAMPressureCache(LRUCache):
|
|||||||
self.used_generation.pop(key, None)
|
self.used_generation.pop(key, None)
|
||||||
self.timestamps.pop(key, None)
|
self.timestamps.pop(key, None)
|
||||||
self.children.pop(key, None)
|
self.children.pop(key, None)
|
||||||
gc.collect()
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user