Also, please report it as a bug if this keeps going even without symfony's
profiler in place.

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/


On 21 February 2013 21:06, Cameron Junge <cameron.ju...@sella.co.nz> wrote:

> Disable debug, add --no-debug when calling the command.
>
>
> On Friday, February 22, 2013 8:47:05 AM UTC+13, Phill Pafford wrote:
>>
>> Did this ever get resolved? Having a similar issue
>>
>> On Monday, January 30, 2012 6:43:17 AM UTC-5, Damian Wróblewski wrote:
>>>
>>> Hello.
>>>
>>> I'm having simple test entity:
>>>
>>>
>>>> class test
>>>> {
>>>>     /**
>>>>      * @var integer $id
>>>>      */
>>>>     private $id;
>>>>
>>>>     /**
>>>>      * @var string $test
>>>>      */
>>>>     private $test;
>>>>
>>>>     // get/set methods
>>>> }
>>>>
>>>
>>> and command:
>>>
>>>>     protected function execute(InputInterface $input, OutputInterface
>>>> $output) {
>>>>
>>>>         $doctrine = $this -> getContainer() -> get('doctrine');
>>>>         /* @var $doctrine \Symfony\Bundle\**DoctrineBundle\Registry */
>>>>
>>>>         $em = $doctrine -> getEntityManager();
>>>>         /* @var $em \Doctrine\ORM\EntityManager */
>>>>         $em -> getconfiguration() -> setSQLLogger(null);
>>>>
>>>>
>>>>         $mem_start = memory_get_usage();
>>>>         gc_collect_cycles();
>>>>         for ($i = 1; $i < 1000; $i++) {
>>>>             $test = new Test();
>>>>             $test -> setTest(str_repeat('xy', 100));
>>>>
>>>>             $em -> persist($test);
>>>>
>>>>
>>>>
>>>>             if ($i % 50 == 0) {
>>>>                 $em -> flush($test);
>>>>                 $em -> clear();
>>>>                 gc_collect_cycles();
>>>>                 echo sprintf('%06d', $i).": ";
>>>>                 echo number_format(memory_get_**usage() -
>>>> $mem_start)."\n";
>>>>             }
>>>>         }
>>>>     }
>>>>
>>>
>>> after execution of this command output looks like this:
>>>
>>>> 000050: 2,204,656
>>>> 000100: 2,334,232
>>>> 000150: 2,464,576
>>>> 000200: 2,593,384
>>>> 000250: 2,722,192
>>>> 000300: 2,854,072
>>>> 000350: 2,982,880
>>>> 000400: 3,111,688
>>>> 000450: 3,240,496
>>>> 000500: 3,369,304
>>>> 000550: 3,504,256
>>>> 000600: 3,665,832
>>>> 000650: 3,794,640
>>>> 000700: 3,923,448
>>>> 000750: 4,052,256
>>>> 000800: 4,181,064
>>>> 000850: 4,309,872
>>>> 000900: 4,438,680
>>>> 000950: 4,567,488
>>>>
>>>
>>>
>>> so after inserting 1000 rows memory usage incrased for almost 5mb!
>>>
>>> So i tried to ommit using entityManager:
>>>
>>>> protected function execute(InputInterface $input, OutputInterface
>>>> $output) {
>>>>
>>>>         $doctrine = $this -> getContainer() -> get('doctrine');
>>>>         /* @var $doctrine \Symfony\Bundle\**DoctrineBundle\Registry */
>>>>
>>>>         $em = $doctrine -> getEntityManager();
>>>>         /* @var $em \Doctrine\ORM\EntityManager */
>>>>         $em -> getconfiguration() -> setSQLLogger(null);
>>>>
>>>>
>>>>         $connection = $doctrine -> getConnection();
>>>>         /* @var $connection \Doctrine\DBAL\Connection */
>>>>
>>>>         $mem_start = memory_get_usage();
>>>>         gc_collect_cycles();
>>>>         for ($i = 1; $i < 1000; $i++) {
>>>>
>>>>             $connection -> insert('test', array (
>>>>                 'test' => str_repeat('xy', 100)));
>>>>
>>>>
>>>>             if ($i % 50 == 0) {
>>>>                 gc_collect_cycles();
>>>>                 echo sprintf('%06d', $i).": ";
>>>>                 echo number_format(memory_get_**usage() -
>>>> $mem_start)."\n";
>>>>             }
>>>>         }
>>>>     }
>>>>
>>> But output is like this:
>>>
>>>> 000050: 279,744
>>>> 000100: 417,712
>>>> 000150: 556,448
>>>> 000200: 693,648
>>>> 000250: 830,848
>>>> 000300: 971,120
>>>> 000350: 1,108,320
>>>> 000400: 1,245,520
>>>> 000450: 1,382,720
>>>> 000500: 1,519,920
>>>> 000550: 1,663,264
>>>> 000600: 1,800,464
>>>> 000650: 1,937,664
>>>> 000700: 2,107,632
>>>> 000750: 2,244,832
>>>> 000800: 2,382,032
>>>> 000850: 2,519,232
>>>> 000900: 2,656,432
>>>> 000950: 2,793,632
>>>>
>>>
>>> Twice less but still no good.
>>>
>>> Any 1 knows what should I do to get rid of these memory leaks? Mb it's
>>> just some bug that should be reported?
>>> My configuration: Windows XP 32 bit / server: xampp
>>> xampp-win32-1.7.7-VC9
>>>
>>>
>>>
>>>
>>>  --
> --
> If you want to report a vulnerability issue on Symfony, please read the
> procedure on http://symfony.com/security
>
> You received this message because you are subscribed to the Google
> Groups "symfony developers" group.
> To post to this group, send email to symfony-devs@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-devs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-devs?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Symfony developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to symfony-devs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
If you want to report a vulnerability issue on Symfony, please read the 
procedure on http://symfony.com/security

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Symfony developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to symfony-devs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to