When an entity is deleted, its log entries are no longer all deleted right away.
Before, hook_entity_predelete() deleted every log entry of the entity in one go. With a lot of log entries (e.g. 80,000 for a single user) this ran out of memory.
Now only the first batch is deleted right away. The batch size is the "Batch size" setting of the module (default 100). If more entries are left, they are added to the entity_logger_target_cleanup queue, which deletes them in batches on cron.
So for entities with a lot of log entries, the remaining entries stay in the database until cron has processed the queue. In the meantime they point to an entity that no longer exists. Make sure cron runs on your site. If a retention period is configured, the retention cleanup will also remove them eventually. #3616509 is a follow-up to sweep entries whose target entity no longer exists.
For developers: EntityLogEntryStorageInterface::deleteForTargetEntity() is removed. It is replaced by deleteForTarget(), which deletes one batch of log entries for a target type and ID, and hasEntriesForTarget().
Before:
$storage->deleteForTargetEntity($entity);
After (to delete all entries in one request, like before):
$type = $entity->getEntityTypeId();
$id = (string) $entity->id();
while ($storage->hasEntriesForTarget($type, $id)) {
$storage->deleteForTarget($type, $id, 100);
}