title: symfony 4 Doctrine service allowed memory size exhausted
body: <p>I inject '@doctrine.orm.entity_manager' in a simple class service like this:</p>
  
  <pre><code>tigris_base.array_to_form:
      class: Tigris\BaseBundle\Service\ArrayToFormService
      arguments: ['@form.factory', '@doctrine.orm.entity_manager']
      public: true
  </code></pre>
  
  <p>And my service constructor</p>
  
  <pre><code>public function __construct(FormFactory $formFactory, EntityManagerInterface $entityManager)
  {
      $this-&gt;formFactory = $formFactory;
      $this-&gt;entityManager = $entityManager;
  }
  </code></pre>
  
  <p>But I have an error:</p>
  
  <blockquote>
    <p>Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes)</p>
  </blockquote>
  
  <p>I try to set a higher value in PHP.ini.
  I don't understand why I have this error, I use doctrine services in other services and it works.</p>
  
  <p>Do you know where is the problem ?</p>
  
  <p>Thanks.</p>