mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-21 01:29:33 +00:00
Do not call gc_collect_cycles in the loop to process the results, but only after all processBatch calls
This commit is contained in:
parent
4d3114b49c
commit
9ae7f320cf
1 changed files with 7 additions and 5 deletions
|
|
@ -382,8 +382,15 @@ class OEMSecretsProvider implements InfoProviderInterface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Force garbage collection to free up memory
|
||||||
|
gc_collect_cycles();
|
||||||
|
|
||||||
// Sort of the results
|
// Sort of the results
|
||||||
$this->sortResultsData($results, $keyword);
|
$this->sortResultsData($results, $keyword);
|
||||||
|
|
||||||
|
//Force garbage collection to free up memory
|
||||||
|
gc_collect_cycles();
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -645,11 +652,6 @@ class OEMSecretsProvider implements InfoProviderInterface
|
||||||
vendor_infos: $purchaseInfoResults[$provider_id] ?? []
|
vendor_infos: $purchaseInfoResults[$provider_id] ?? []
|
||||||
);
|
);
|
||||||
|
|
||||||
// Force garbage collection to deallocate unused memory cycles
|
|
||||||
// Without this instruction, when in dev mode, after the first or second call to getDetails,
|
|
||||||
// a memory error occurs due to memory not being freed properly, leading to memory exhaustion.
|
|
||||||
gc_collect_cycles();
|
|
||||||
|
|
||||||
return $partDetailDTO;
|
return $partDetailDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue