Skip to content

Commit

Permalink
temporary horrible hack for annoying janus memory issue
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewcropper committed Jun 25, 2024
1 parent 4bdcfb1 commit 690d730
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions popper/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ def run(self, bkcons):

settings.stats.total_programs += 1

if settings.stats.total_programs % 10000 == 0:
tester.janus_clear_cache()

if settings.debug:
settings.logger.debug(f'Program {settings.stats.total_programs}:')
settings.logger.debug(format_prog(prog))
Expand Down
3 changes: 3 additions & 0 deletions popper/tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ def __init__(self, settings):
if self.settings.recursion_enabled:
query_once(f'assert(timeout({self.settings.eval_timeout})), fail')

def janus_clear_cache(self):
return query_once('retractall(janus:py_call_cache(_String,_Input,_TV,_M,_Goal,_Dict,_Truth,_OutVars))')

# AC: THIS METHOD IS VERY EXPENSIVE, ESPECIALLY THE ORDER_RULE CALL
@cache
def parse_single_rule(self, prog):
Expand Down

0 comments on commit 690d730

Please sign in to comment.