Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
300 views
in Technique[技术] by (71.8m points)

php - Out of memory error in symfony

I'm currently working on Symfony project (const VERSION ='2.5.10') and I am using xampp. PHP version is 5.5.19.

My problem is everytime I run my dev environment I get an error :

OutOfMemoryException: Error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 3358976 bytes) in C:xampphtdocsEditrackervendorsymfonysymfonysrcSymfonyComponentHttpKernelProfilerFileProfilerStorage.php line 153

and everytime I refresh the page it gives different memory size. I also think that this is also the reason why my dev environment takes a lont time before it refreshes the page.

Your help is appreciated.

php.ini

memory_limit= '256M'

I tried to increase my memory limit,still it gives an error about memory limit

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The most eager component in Symfony is a profiler. If you don't need profiler in some particular actions you can disable it via code:

if ($this->container->has('profiler'))
{
    $this->container->get('profiler')->disable();
}

You can also set global parameter in config:

framework:
    profiler:
        collect: false

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...