def __init__(self, maxMemory=None, every=<NUM_LIT:1>):
if maxMemory is None:<EOL><INDENT>mem = virtual_memory()<EOL>maxMemory =  <NUM_LIT:0.5> * mem.total/<NUM_LIT>**<NUM_LIT:3><EOL><DEDENT>self.maxMemory = maxMemory<EOL>self.every = every<EOL>
maxMemory [GB]
    not not set, set to 50% of avail memory
every [sec]

This function starts a daemon thread
which checks memory usage by the current Python instance [every] seconds
if [maxMemory] limit is reached it stops Python
###
with this nerving system freezes can be avoided