found the underlying issue with memory management: when gc() did NOT free up enough memory, it went to an endless cycle, trying to get memory usage below threshold but not succeeding in doing so