dongwen3410 2017-03-07 11:27
浏览 208

php脚本有多少内存? 我可以在执行期间释放内存吗?

Can php script get allowed memory size and also how much memory can be allocated? I know that it is possible to clean memory using unset. But I'll like to understand how to create php scripts that consume less memory as possibile.

  • 写回答

2条回答 默认 最新

  • dpwfh874876 2017-03-07 11:38
    关注

    unset will free the memory.

    Though major memory consumption will be on the resources from io, db etc.

    And for these tasks, it is very important to release the memory or free up the sources for further utilisation.

    Also to note that while processing, the processed data will also have near similar usage. Hence freeing that after usage will also improve the use case.

    To go more and more memory less, make functions pure as much as possible, where after execution of function, there is only output and no side effect. With this there will be less things in global memory space.

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度