core: fix high memory usage while process conditions