drip5880 2015-05-14 05:05
浏览 91
已采纳

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:\xampp\htdocs\Editracker\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Profiler\FileProfilerStorage.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

  • 写回答

5条回答 默认 最新

  • doubu8643 2015-05-14 05:27
    关注

    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
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用