Skip to content

Commit

Permalink
Merge pull request #9583 from nextcloud/backport/9581/stable3.6
Browse files Browse the repository at this point in the history
[stable3.6] fix(threading): Run manual garbage collection
  • Loading branch information
st3iny authored May 16, 2024
2 parents 089f311 + ed96290 commit d59eebb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Listener/AccountSynchronizedThreadUpdaterListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use function array_chunk;
use function gc_collect_cycles;
use function iterator_to_array;

/**
Expand Down Expand Up @@ -79,6 +80,10 @@ public function handle(Event $event): void {

$logger->debug("Chunk of " . self::WRITE_IDS_CHUNK_SIZE . " messages updated");
}

// Free memory
unset($flattened, $threads, $messages);
gc_collect_cycles();
}

/**
Expand Down

0 comments on commit d59eebb

Please sign in to comment.