Fatal error: Allowed memory size of 805306368 bytes exhausted (tried to allocate 1114112 bytes) in /www/htdocs/w01d9cb2/dev/shopware/spruegel/vendor/doctrine/dbal/src/Driver/PDO/Statement.php on line 55

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/w01d9cb2/dev/shopware/spruegel/vendor/doctrine/dbal/src/Driver/PDO/Statement.php:55) in /www/htdocs/w01d9cb2/dev/shopware/spruegel/vendor/symfony/http-foundation/Session/SessionUtils.php on line 52
Error: Allowed memory size of 805306368 bytes exhausted (tried to allocate 1114112 bytes) (500 Internal Server Error)

Symfony Exception

OutOfMemoryError

HTTP 500 Internal Server Error

Error: Allowed memory size of 805306368 bytes exhausted (tried to allocate 1114112 bytes)

Exception

Symfony\Component\ErrorHandler\Error\ OutOfMemoryError

Show exception properties
Symfony\Component\ErrorHandler\Error\OutOfMemoryError {#10927
  -error: array:4 [
    "type" => 1
    "message" => "Allowed memory size of 805306368 bytes exhausted (tried to allocate 1114112 bytes)"
    "file" => "/www/htdocs/w01d9cb2/dev/shopware/spruegel/vendor/doctrine/dbal/src/Driver/PDO/Statement.php"
    "line" => 55
  ]
}
  1. }
  2. public function execute(): Result
  3. {
  4. try {
  5. $this->stmt->execute();
  6. } catch (PDOException $exception) {
  7. throw Exception::new($exception);
  8. }
  9. return new Result($this->stmt);
  1. }
  2. public function execute(): Result
  3. {
  4. try {
  5. $this->stmt->execute();
  6. } catch (PDOException $exception) {
  7. throw Exception::new($exception);
  8. }
  9. return new Result($this->stmt);
  1. $this->wrappedStatement->bindValue($param, $value, $type);
  2. }
  3. public function execute(): Result
  4. {
  5. return $this->wrappedStatement->execute();
  6. }
  7. }
  1. public function execute(): Result
  2. {
  3. $this->counter->increment();
  4. return parent::execute();
  5. }
  6. }
  1. $stmt = $connection->prepare($sql);
  2. $this->bindParameters($stmt, $params, $types);
  3. $result = $stmt->execute();
  4. } else {
  5. $result = $connection->query($sql);
  6. }
  7. return new Result($result, $this);
  1. *
  2. * @throws Exception
  3. */
  4. public function executeQuery(): Result
  5. {
  6. return $this->connection->executeQuery(
  7. $this->getSQL(),
  8. $this->params,
  9. $this->types,
  10. $this->resultCacheProfile,
  11. );
  1. if ($criteria->getTitle()) {
  2. $query->setTitle($criteria->getTitle() . '::read');
  3. }
  4. return $query->executeQuery()->fetchAllAssociative();
  5. }
  6. /**
  7. * @param EntityCollection<Entity> $collection
  8. * @param array<string, mixed> $fieldsForPartialLoading
  1. if ($definition->isInheritanceAware() && $criteria->hasAssociation('parent')) {
  2. throw DataAbstractionLayerException::parentAssociationCannotBeFetched();
  3. }
  4. $rows = $this->fetch($criteria, $definition, $context, $fields, $fieldsForPartialLoading);
  5. $collection = $this->hydrator->hydrate(
  6. $collection,
  7. $definition->getEntityClass(),
  8. $definition,
  1. if ($criteria->getExcludedFields() !== []) {
  2. $this->assertExcludableFields($definition, $criteria->getExcludedFields());
  3. }
  4. return $this->_read(
  5. $criteria,
  6. $definition,
  7. $context,
  8. new $collectionClass(),
  9. $definition->getFields()->getBasicFields(),
  1. {
  2. $criteria = clone $criteria;
  3. /** @var TEntityCollection $entities */
  4. // @phpstan-ignore varTag.type (phpstan can't detect that TEntityCollection is always an EntityCollection<Entity>)
  5. $entities = $this->reader->read($this->definition, $criteria, $salesChannelContext->getContext());
  6. if ($criteria->getFields() === []) {
  7. $events = $this->eventFactory->createForSalesChannel($entities->getElements(), $salesChannelContext);
  8. } else {
  9. $events = $this->eventFactory->createPartialForSalesChannel($entities->getElements(), $salesChannelContext);
  1. return new EntitySearchResult($this->definition->getEntityName(), $ids->getTotal(), new $collection(), $aggregations, $criteria, $salesChannelContext->getContext());
  2. }
  3. $readCriteria = $criteria->cloneForRead($ids->getIds());
  4. $entities = $this->read($readCriteria, $salesChannelContext);
  5. $search = $ids->getData();
  6. if (!$criteria->hasState(Criteria::STATE_DISABLE_SEARCH_INFO)) {
  7. foreach ($entities as $element) {
  1. *
  2. * @return EntitySearchResult<TEntityCollection>
  3. */
  4. public function search(Criteria $criteria, SalesChannelContext $salesChannelContext): EntitySearchResult
  5. {
  6. $searchFn = fn (): EntitySearchResult => $this->profile($criteria, fn (): EntitySearchResult => $this->_search($criteria, $salesChannelContext));
  7. return $this->dalSearchInstrumentor?->measure(
  8. DalSearchInstrumentor::OPERATION_SEARCH,
  9. $this->definition,
  10. $criteria,
in vendor/shopware/core/Profiling/Profiler.php -> {closure:{closure:Shopware\Core\System\SalesChannel\Entity\SalesChannelRepository::search():72}:72} (line 67)
  1. try {
  2. foreach (self::$profilers as $profiler) {
  3. $profiler->start($name, $category, $tags);
  4. }
  5. $result = $closure();
  6. } finally {
  7. foreach (self::$profilers as $profiler) {
  8. $profiler->stop($name);
  9. }
  10. }
  1. */
  2. private function profile(Criteria $criteria, \Closure $fn): mixed
  3. {
  4. $title = $criteria->getTitle();
  5. return $title === null ? $fn() : Profiler::trace($title, $fn, 'saleschannel-repository');
  6. }
  7. /**
  8. * @return TEntityCollection
  9. */
  1. *
  2. * @return EntitySearchResult<TEntityCollection>
  3. */
  4. public function search(Criteria $criteria, SalesChannelContext $salesChannelContext): EntitySearchResult
  5. {
  6. $searchFn = fn (): EntitySearchResult => $this->profile($criteria, fn (): EntitySearchResult => $this->_search($criteria, $salesChannelContext));
  7. return $this->dalSearchInstrumentor?->measure(
  8. DalSearchInstrumentor::OPERATION_SEARCH,
  9. $this->definition,
  10. $criteria,
in vendor/shopware/core/Framework/DataAbstractionLayer/Telemetry/DalSearchInstrumentor.php -> {closure:Shopware\Core\System\SalesChannel\Entity\SalesChannelRepository::search():72} (line 76)
  1. * @return TReturn
  2. */
  3. public function measure(string $operation, EntityDefinition $definition, Criteria $criteria, \Closure $callback): mixed
  4. {
  5. if (!$this->enabled) {
  6. return $callback();
  7. }
  8. $timer = ElapsedTimer::start();
  9. try {
  10. $result = $callback();
  1. */
  2. public function search(Criteria $criteria, SalesChannelContext $salesChannelContext): EntitySearchResult
  3. {
  4. $searchFn = fn (): EntitySearchResult => $this->profile($criteria, fn (): EntitySearchResult => $this->_search($criteria, $salesChannelContext));
  5. return $this->dalSearchInstrumentor?->measure(
  6. DalSearchInstrumentor::OPERATION_SEARCH,
  7. $this->definition,
  8. $criteria,
  9. $searchFn,
  10. ) ?? $searchFn();
  1. ->addSorting(new FieldSorting('productNumber'))
  2. ->setLimit(self::VARIANT_LIMIT);
  3. $criteria->setTitle('cookie-theme::product-variant-matrix');
  4. return $this->productRepository->search($criteria, $context)->getEntities();
  5. }
  6. /**
  7. * @return list<array{quantity: int, net: float, gross: float}>
  8. */
ProductVariantMatrixSubscriber->loadVariants() in custom/plugins/CookieTheme/src/Subscriber/ProductVariantMatrixSubscriber.php (line 67)
  1. if ($matrixGroup === null) {
  2. return;
  3. }
  4. $context = $event->getSalesChannelContext();
  5. $variants = $this->loadVariants($parentId, $context);
  6. if ($variants->count() === 0) {
  7. return;
  8. }
  1. $this->priority ??= $dispatcher->getListenerPriority($eventName, $this->listener);
  2. $e = $this->stopwatch->start($this->name, 'event_listener');
  3. try {
  4. ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);
  5. } finally {
  6. if ($e->isStarted()) {
  7. $e->stop();
  8. }
  9. }
  1. foreach ($listeners as $listener) {
  2. if ($stoppable && $event->isPropagationStopped()) {
  3. break;
  4. }
  5. $listener($event, $eventName, $this);
  6. }
  7. }
  8. /**
  9. * Sorts the internal list of listeners for the given event by priority.
  1. } else {
  2. $listeners = $this->getListeners($eventName);
  3. }
  4. if ($listeners) {
  5. $this->callListeners($listeners, $eventName, $event);
  6. }
  7. return $event;
  8. }
  1. *
  2. * @return TEvent
  3. */
  4. public function dispatch(object $event, ?string $eventName = null): object
  5. {
  6. $event = $this->dispatcher->dispatch($event, $eventName);
  7. if (!$event instanceof FlowEventAware) {
  8. return $event;
  9. }
  1. ) {
  2. }
  3. public function dispatch(object $event, ?string $eventName = null): object
  4. {
  5. $event = $this->dispatcher->dispatch($event, $eventName);
  6. if (!HookableEventFactory::isHookable($event)) {
  7. return $event;
  8. }
  1. }
  2. $this->dispatch($nested, $name);
  3. }
  4. }
  5. return $this->dispatcher->dispatch($event, $eventName);
  6. }
  7. /**
  8. * @param callable $listener can not use native type declaration @see https://github.com/symfony/symfony/issues/42283
  9. */
  1. try {
  2. $this->beforeDispatch($eventName, $event);
  3. try {
  4. $e = $this->stopwatch->start($eventName, 'section');
  5. try {
  6. $this->dispatcher->dispatch($event, $eventName);
  7. } finally {
  8. if ($e->isStarted()) {
  9. $e->stop();
  10. }
  11. }
  1. if (Feature::isActive('JSON_LD_DATA')) {
  2. $this->loadStructuredDataReviews($page, $context);
  3. }
  4. $this->eventDispatcher->dispatch(
  5. new ProductPageLoadedEvent($page, $context, $request)
  6. );
  7. return $page;
  8. }
  1. defaults: [PlatformRequest::ATTRIBUTE_HTTP_CACHE => true],
  2. methods: [Request::METHOD_GET]
  3. )]
  4. public function index(SalesChannelContext $context, Request $request): Response
  5. {
  6. $page = $this->productPageLoader->load($request, $context);
  7. $this->hook(new ProductPageLoadedHook($page, $context));
  8. return $this->renderStorefront(
  9. '@Storefront/storefront/page/content/product-detail.html.twig',
  1. $this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
  2. $controller = $event->getController();
  3. $arguments = $event->getArguments();
  4. // call controller
  5. $response = $controller(...$arguments);
  6. // view
  7. if (!$response instanceof Response) {
  8. $event = new ViewEvent($this, $request, $type, $response, $event);
  9. $this->dispatcher->dispatch($event, KernelEvents::VIEW);
  1. $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  2. $this->requestStack->push($request);
  3. $response = null;
  4. try {
  5. return $response = $this->handleRaw($request, $type);
  6. } catch (\Throwable $e) {
  7. if ($e instanceof \Error && !$this->handleAllThrowables) {
  8. throw $e;
  9. }
  1. $this->dispatcher->dispatch($event);
  2. return $event->getResponse();
  3. }
  4. return parent::handle($request, $type, $catch);
  5. }
  6. }
  1. if (!IpUtils::checkIp('127.0.0.1', $trustedProxies)) {
  2. Request::setTrustedProxies(array_merge($trustedProxies, ['127.0.0.1']), Request::getTrustedHeaderSet());
  3. }
  4. try {
  5. return $kernel->handle($request, $type, $catch);
  6. } finally {
  7. // restore global state
  8. Request::setTrustedProxies($trustedProxies, $trustedHeaderSet);
  9. }
  10. }
  1. protected function forward(Request $request, bool $catch = false, ?Response $entry = null): Response
  2. {
  3. $this->surrogate?->addSurrogateCapability($request);
  4. // always a "master" request (as the real master request can be in cache)
  5. $response = SubRequestHandler::handle($this->kernel, $request, HttpKernelInterface::MAIN_REQUEST, $catch);
  6. $this->forwardedRequest = $request;
  7. // These headers drive how the body is restored before sending the response.
  8. // Only the store and the surrogate may set them, never the backend.
  9. $response->headers->remove('X-Body-File');
  1. // avoid that the backend sends no content
  2. $subRequest->headers->remove('If-Modified-Since');
  3. $subRequest->headers->remove('If-None-Match');
  4. $response = $this->forward($subRequest, $catch);
  5. if ($response->isCacheable()) {
  6. $this->store($request, $response);
  7. }
  1. }
  2. if (null === $entry) {
  3. $this->record($request, 'miss');
  4. return $this->fetch($request, $catch);
  5. }
  6. if (!$this->isFreshEnough($request, $entry)) {
  7. $this->record($request, 'stale');
  1. $response = $this->fetch($request, $catch);
  2. } else {
  3. $response = null;
  4. do {
  5. try {
  6. $response = $this->lookup($request, $catch);
  7. } catch (CacheWasLockedException) {
  8. }
  9. } while (null === $response);
  10. }
  1. // only handle main request inside http cache, because ESI tags are also interpreted as main request.
  2. // sub requests are requests, which are forwarded to the kernel inside the php stack
  3. // https://github.com/symfony/symfony/issues/51648#issuecomment-1717846894
  4. if ($type === HttpKernelInterface::MAIN_REQUEST) {
  5. $response = parent::handle($request, $type, $catch);
  6. } elseif ($request->attributes->has('_sw_esi')) {
  7. $response = parent::handle($request, $type, $catch);
  8. } else {
  9. $response = $this->getKernel()->handle($request, $type, $catch);
  10. }
in vendor/shopware/core/Kernel.php -> handle (line 136)
  1. public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response
  2. {
  3. $this->boot();
  4. return $this->getHttpKernel()->handle($request, $type, $catch);
  5. }
  6. public function boot(): void
  7. {
  8. if (!$this->booted) {
  1. ) {
  2. }
  3. public function run(): int
  4. {
  5. $response = $this->kernel->handle($this->request);
  6. $response->send(false);
  7. if (\function_exists('fastcgi_finish_request') && !$this->debug) {
  8. fastcgi_finish_request();
in vendor/autoload_runtime.php -> run (line 32)
  1. $app = $app(...$args);
  2. exit(
  3. $runtime
  4. ->getRunner($app)
  5. ->run()
  6. );
require_once() in public/index.php (line 11)
  1. use Shopware\Core\Installer\InstallerKernel;
  2. use Shopware\Core\Framework\Adapter\Kernel\KernelFactory;
  3. $_SERVER['SCRIPT_FILENAME'] = __FILE__;
  4. require_once __DIR__ . '/../vendor/autoload_runtime.php';
  5. if (!file_exists(__DIR__ . '/../.env') && !file_exists(__DIR__ . '/../.env.dist') && !file_exists(__DIR__ . '/../.env.local.php')) {
  6. $_SERVER['APP_RUNTIME_OPTIONS']['disable_dotenv'] = true;
  7. }

Stack Trace

OutOfMemoryError
Symfony\Component\ErrorHandler\Error\OutOfMemoryError:
Error: Allowed memory size of 805306368 bytes exhausted (tried to allocate 1114112 bytes)

  at vendor/doctrine/dbal/src/Driver/PDO/Statement.php:55
  at PDOStatement->execute()
     (vendor/doctrine/dbal/src/Driver/PDO/Statement.php:55)
  at Doctrine\DBAL\Driver\PDO\Statement->execute()
     (vendor/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php:24)
  at Doctrine\DBAL\Driver\Middleware\AbstractStatementMiddleware->execute()
     (vendor/shopware/core/Framework/Telemetry/Doctrine/QueryCountStatement.php:33)
  at Shopware\Core\Framework\Telemetry\Doctrine\QueryCountStatement->execute()
     (vendor/doctrine/dbal/src/Connection.php:800)
  at Doctrine\DBAL\Connection->executeQuery()
     (vendor/doctrine/dbal/src/Query/QueryBuilder.php:323)
  at Doctrine\DBAL\Query\QueryBuilder->executeQuery()
     (vendor/shopware/core/Framework/DataAbstractionLayer/Dbal/EntityReader.php:429)
  at Shopware\Core\Framework\DataAbstractionLayer\Dbal\EntityReader->fetch()
     (vendor/shopware/core/Framework/DataAbstractionLayer/Dbal/EntityReader.php:180)
  at Shopware\Core\Framework\DataAbstractionLayer\Dbal\EntityReader->_read()
     (vendor/shopware/core/Framework/DataAbstractionLayer/Dbal/EntityReader.php:94)
  at Shopware\Core\Framework\DataAbstractionLayer\Dbal\EntityReader->read()
     (vendor/shopware/core/System/SalesChannel/Entity/SalesChannelRepository.php:222)
  at Shopware\Core\System\SalesChannel\Entity\SalesChannelRepository->read()
     (vendor/shopware/core/System/SalesChannel/Entity/SalesChannelRepository.php:140)
  at Shopware\Core\System\SalesChannel\Entity\SalesChannelRepository->_search()
     (vendor/shopware/core/System/SalesChannel/Entity/SalesChannelRepository.php:72)
  at Shopware\Core\System\SalesChannel\Entity\SalesChannelRepository->{closure:{closure:Shopware\Core\System\SalesChannel\Entity\SalesChannelRepository::search():72}:72}()
     (vendor/shopware/core/Profiling/Profiler.php:67)
  at Shopware\Core\Profiling\Profiler::trace()
     (vendor/shopware/core/System/SalesChannel/Entity/SalesChannelRepository.php:210)
  at Shopware\Core\System\SalesChannel\Entity\SalesChannelRepository->profile()
     (vendor/shopware/core/System/SalesChannel/Entity/SalesChannelRepository.php:72)
  at Shopware\Core\System\SalesChannel\Entity\SalesChannelRepository->{closure:Shopware\Core\System\SalesChannel\Entity\SalesChannelRepository::search():72}()
     (vendor/shopware/core/Framework/DataAbstractionLayer/Telemetry/DalSearchInstrumentor.php:76)
  at Shopware\Core\Framework\DataAbstractionLayer\Telemetry\DalSearchInstrumentor->measure()
     (vendor/shopware/core/System/SalesChannel/Entity/SalesChannelRepository.php:74)
  at Shopware\Core\System\SalesChannel\Entity\SalesChannelRepository->search()
     (custom/plugins/CookieTheme/src/Subscriber/ProductVariantMatrixSubscriber.php:171)
  at CookieTheme\Subscriber\ProductVariantMatrixSubscriber->loadVariants()
     (custom/plugins/CookieTheme/src/Subscriber/ProductVariantMatrixSubscriber.php:67)
  at CookieTheme\Subscriber\ProductVariantMatrixSubscriber->onProductPageLoaded()
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:115)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:206)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:56)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
     (vendor/shopware/core/Content/Flow/Dispatching/FlowDispatcher.php:43)
  at Shopware\Core\Content\Flow\Dispatching\FlowDispatcher->dispatch()
     (vendor/shopware/core/Framework/Webhook/WebhookDispatcher.php:28)
  at Shopware\Core\Framework\Webhook\WebhookDispatcher->dispatch()
     (vendor/shopware/core/Framework/Event/NestedEventDispatcher.php:31)
  at Shopware\Core\Framework\Event\NestedEventDispatcher->dispatch()
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:129)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (vendor/shopware/storefront/Page/Product/ProductPageLoader.php:127)
  at Shopware\Storefront\Page\Product\ProductPageLoader->load()
     (vendor/shopware/storefront/Controller/ProductController.php:64)
  at Shopware\Storefront\Controller\ProductController->index()
     (vendor/symfony/http-kernel/HttpKernel.php:185)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/shopware/core/Framework/Adapter/Kernel/HttpKernel.php:72)
  at Shopware\Core\Framework\Adapter\Kernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php:86)
  at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:476)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:453)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:351)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:220)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle()
     (vendor/shopware/core/Framework/Adapter/Kernel/HttpCacheKernel.php:66)
  at Shopware\Core\Framework\Adapter\Kernel\HttpCacheKernel->handle()
     (vendor/shopware/core/Kernel.php:136)
  at Shopware\Core\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:34)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:32)
  at require_once()
     (public/index.php:11)