Skip to content

Commit

Permalink
disable gc code
Browse files Browse the repository at this point in the history
  • Loading branch information
pipiche38 committed Nov 14, 2023
1 parent 038af64 commit 991cd5e
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,10 @@ def onStart(self):
self.zigbee_communication, self.VersionNewFashion, self.DomoticzMajor, self.DomoticzMinor, Parameters["HomeFolder"], self.HardwareID
)

if self.pluginconf.pluginConf["Garbage"]:
# Enable the cycle detector
Domoticz.Log("Setup Garbage set_debug to %s" %gc.DEBUG_LEAK)
gc.set_debug(gc.DEBUG_LEAK)
#if self.pluginconf.pluginConf["Garbage"]:
# # Enable the cycle detector
# Domoticz.Log("Setup Garbage set_debug to %s" %gc.DEBUG_LEAK)
# gc.set_debug(gc.DEBUG_LEAK)

# Create Domoticz Sub menu
if "DomoticzCustomMenu" in self.pluginconf.pluginConf and self.pluginconf.pluginConf["DomoticzCustomMenu"] :
Expand Down Expand Up @@ -735,17 +735,17 @@ def onStop(self): # sourcery skip: class-extract-method
if self.adminWidgets:
self.adminWidgets.updateStatusWidget(Devices, "No Communication")

if self.pluginconf.pluginConf["Garbage"]:

# Domoticz.Log( "Garbage Collected objects:")
# objects = gc.get_objects()
# for item in objects:
# Domoticz.Log( "- %s" %str(item))

# Print detected cycles (garbage collectors)
Domoticz.Log( "Garbage Collected detected cycles:")
for item in gc.garbage:
Domoticz.Log("- %s" %str(item))
#if self.pluginconf.pluginConf["Garbage"]:
#
# # Domoticz.Log( "Garbage Collected objects:")
# # objects = gc.get_objects()
# # for item in objects:
# # Domoticz.Log( "- %s" %str(item))
#
# # Print detected cycles (garbage collectors)
# Domoticz.Log( "Garbage Collected detected cycles:")
# for item in gc.garbage:
# Domoticz.Log("- %s" %str(item))



Expand Down Expand Up @@ -1684,10 +1684,11 @@ def uninstall_Z4D_to_domoticz_custom_ui():

def do_python_garbage_collection( self ):
# Garbage collector ( experimental for now)
if self.internalHB % (3600 // HEARTBEAT) == 0:
self.log.logging("Garbage", "Debug", "Garbage Collection status: %s" % str(gc.get_count()) )
self.log.logging("Garbage", "Debug", "Garbage collection statistics: %s" % str( gc.get_stats()) )
# self.log.logging("Garbage", "Debug", "Garbage Collection triggered: %s" % str(gc.collect()) )
pass
#if self.internalHB % (3600 // HEARTBEAT) == 0:
# self.log.logging("Garbage", "Debug", "Garbage Collection status: %s" % str(gc.get_count()) )
# self.log.logging("Garbage", "Debug", "Garbage collection statistics: %s" % str( gc.get_stats()) )
# # self.log.logging("Garbage", "Debug", "Garbage Collection triggered: %s" % str(gc.collect()) )

def _check_if_busy(self):
busy_ = self.ControllerLink.loadTransmit() >= MAX_FOR_ZIGATE_BUZY
Expand Down

0 comments on commit 991cd5e

Please sign in to comment.