use Symfony\Component\DependencyInjection\Definition; $myServiceDefinition = new Definition(MyService::class); $myServiceDefinition->setLazy(true);This sets the isLazy property on the `$myServiceDefinition` object to true. One package library that uses this property is the Doctrine ORM bundle for Symfony. The service definitions for the Doctrine entity manager and other related services are set to be lazy by default, which helps to improve the performance of applications that use Doctrine by only creating these expensive services when they are actually needed.