remove garbage collection entirely
This commit is contained in:
parent
a44082180c
commit
125528c567
24
bert.py
24
bert.py
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/python3 -u
|
#!/usr/bin/python3 -u
|
||||||
|
|
||||||
import gc
|
|
||||||
import socket
|
import socket
|
||||||
import ssl
|
import ssl
|
||||||
import sys
|
import sys
|
||||||
|
@ -503,17 +502,6 @@ def fefe_check():
|
||||||
sleep(300)
|
sleep(300)
|
||||||
|
|
||||||
|
|
||||||
def gc_cycle():
|
|
||||||
while True:
|
|
||||||
try:
|
|
||||||
# fire the garbage collector
|
|
||||||
gc.set_debug(gc.DEBUG_STATS)
|
|
||||||
gc.collect()
|
|
||||||
sleep(120)
|
|
||||||
except Exception as err:
|
|
||||||
print("Error in garbage collector! - "+str(err))
|
|
||||||
|
|
||||||
|
|
||||||
class command_thread(threading.Thread):
|
class command_thread(threading.Thread):
|
||||||
def __init__(self, threadID):
|
def __init__(self, threadID):
|
||||||
threading.Thread.__init__(self)
|
threading.Thread.__init__(self)
|
||||||
|
@ -530,26 +518,14 @@ class fefe_thread(threading.Thread):
|
||||||
print("Starting fefe thread...")
|
print("Starting fefe thread...")
|
||||||
fefe_check()
|
fefe_check()
|
||||||
|
|
||||||
class gc_thread(threading.Thread):
|
|
||||||
def __init__(self, threadID):
|
|
||||||
threading.Thread.__init__(self)
|
|
||||||
self.threadID = threadID
|
|
||||||
def run(self):
|
|
||||||
print("Starting garbage collector thread...")
|
|
||||||
gc_cycle()
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
start(host, port, nick, password, set(join_chans + fefe_chans))
|
start(host, port, nick, password, set(join_chans + fefe_chans))
|
||||||
thread_command = command_thread(1)
|
thread_command = command_thread(1)
|
||||||
#thread_fefe = fefe_thread(2)
|
#thread_fefe = fefe_thread(2)
|
||||||
#thread_gc = gc_thread(3)
|
|
||||||
thread_command.start()
|
thread_command.start()
|
||||||
#sleep(2)
|
#sleep(2)
|
||||||
#thread_fefe.start()
|
#thread_fefe.start()
|
||||||
#sleep(2)
|
|
||||||
#thread_gc.start()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
#gc.enable()
|
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user