{"id":463,"date":"2022-10-02T11:07:27","date_gmt":"2022-10-02T02:07:27","guid":{"rendered":"http:\/\/kamita.net\/program\/?p=463"},"modified":"2022-10-02T13:25:26","modified_gmt":"2022-10-02T04:25:26","slug":"php-%e3%83%a1%e3%83%a2%e3%83%aa%e6%b6%88%e8%b2%bb","status":"publish","type":"post","link":"https:\/\/kamita.net\/program\/?p=463","title":{"rendered":"php \u30e1\u30e2\u30ea\u6d88\u8cbb ini_set(&#8220;memory_limit&#8221;,&#8221;xxxM&#8221;)"},"content":{"rendered":"\n<p>PHP\u3092WEB\u3067\u306f\u306a\u304f\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u4f55\u6642\u9593\u3082\u7d99\u7d9a\u7684\u306b\u52d5\u304b\u3059\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u7a3c\u50cd\u3055\u305b\u3066\u304a\u3044\u305f\u3089\u3001<\/p>\n\n\n\n<p>\u300cPHP Fatal error: Allowed memory size of xxx  bytes exhausted\u300d \u3068\u304b\u3001\u985e\u3059\u308b\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u843d\u3061\u3066\u3057\u307e\u3063\u305f\u3002<br><br>ini_set(&#8220;memory_limit&#8221;,&#8221;xxxM&#8221;);<br>\u3068\u30e1\u30e2\u30ea\u4e0a\u9650\u3092\u4e0a\u3052\u308b\u3053\u3068\u3082\u884c\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3067unset\u306e\u91cd\u8981\u6027\u3092\u8a8d\u8b58\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/suin.io\/505\">https:\/\/suin.io\/505<\/a><\/p>\n\n\n\n<p>\u5927\u91cf\u306e\u6587\u5b57\u5217\u3084\u5927\u91cf\u306e\u914d\u5217\u306a\u3069\u3001\u305d\u306e\u5f8c\u4f7f\u308f\u306a\u3044\u3082\u306e\u306f\u3001\u3067\u304d\u308b\u3060\u3051\u65e9\u304f\u3001unset\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3001<br>memory_get_usage();<br>\u3067\u5927\u91cf\u306e\u30e1\u30e2\u30ea\u6d88\u8cbb\u304c\u3042\u308b\u305d\u3046\u306a\u524d\u5f8c\u3092\u6e2c\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306f\u300183\u56de\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u6700\u5f8c\u4ed8\u8fd1\u3068\u3001\u30eb\u30fc\u30d7\u3092\u629c\u3051\u3066\u5229\u7528\u3057\u3066\u3044\u305f\u914d\u5217\u3092unset\u3057\u305f\u6642\u306e<br>\u30e1\u30e2\u30ea\u306e\u6d88\u8cbb\u91cf\u306e\u30c7\u30fc\u30bf<\/p>\n\n\n\n<p>81\/83<br>memory use before:2308200<br>memory use after:1552784<br>82\/83<br>memory use before:2309848<br>memory use after:1554432<br>83\/83<br>memory use after unset xxx:1538928<\/p>\n\n\n\n<p>before\u306e\u5f8c\u3067\u3042\u308b\u51e6\u7406\u3092\u3057\u3066\u3001\u51e6\u7406\u7d42\u308f\u3063\u305f\u3089after\u3067\u8a08\u6e2c\u3002\u3053\u3053\u3082\u304b\u306a\u308a\u4e0b\u304c\u3063\u3066\u3044\u308b\u3002<br>\u305d\u3057\u3066\u3001\u30eb\u30fc\u30d7\u3092\u629c\u3051\u3066\u6700\u5f8c\u304c\u4e00\u756a\u5c11\u306a\u304f\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u3053\u307e\u3067\u3044\u3044\u306e\u3067\u3059\u304c\u3001\u3053\u306e\u30eb\u30fc\u30d7\u306f\u89aa\u30eb\u30fc\u30d7\u306e\u4e2d\u306e\u3001\u5b50\u30eb\u30fc\u30d7\u3067\u3001<br>\u518d\u5ea6\u3001\u30eb\u30fc\u30d7\u306b\u7a81\u5165\u3057\u305f\u3089\u3001\u6d88\u8cbb\u91cf\u306f\u4e0a\u304c\u3063\u3066\u3044\u307e\u3057\u305f\u3002\u843d\u3061\u308b\u3068\u3053\u308d\u307e\u3067\u8a08\u6e2c\u3057\u3066\u3001\u307e\u305a\u306f\u843d\u3061\u308b\u524d\u306b\u7d42\u4e86\u3055\u305b\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u80cc\u666f)<\/p>\n\n\n\n<p>\u65e5\u9803\u4f7f\u3046\u305d\u3053\u305d\u3053\u306e\u30d1\u30ef\u30fc\u306e\u3042\u308bPC\u306f\u3001\u30b9\u30a4\u30c3\u30c1\u3092\u5207\u308b\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3001<br>windows\u30bf\u30d6\u30ec\u30c3\u30c8\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u305d\u3061\u3089\u306b\u7a3c\u50cd\u3092\u3055\u305b\u3066\u307f\u305f\u3089\u3001\u3053\u306e\u30e1\u30e2\u30ea\u306e\u554f\u984c\u304c\u8d77\u3053\u308a\u307e\u3057\u305f\u3002<br>\u975e\u529b\u306a\u304c\u3089\u3082\u3001\u307b\u307c\u7121\u97f3\u306a\u306e\u3067\u3001\u8d77\u52d5\u3055\u305b\u3066\u304a\u3044\u3066\u3082\u5168\u304f\u6c17\u306b\u306a\u3089\u306a\u3044\u306e\u3067\u3059\u304c\u3002<\/p>\n\n\n\n<p>\u4eca\u5f8c\u306e\u5bfe\u5fdc)<\/p>\n\n\n\n<p>\u4f55\u6642\u9593\u304b\u52d5\u304b\u3057\u3066\u3001\u6d88\u8cbb\u91cf\u304c\u4e0a\u6607\u30e9\u30a4\u30f3\u306b\u4e57\u308b\u306e\u3067\u3042\u308c\u3070\u3001\u4eca\u306e\u3068\u3053\u308d\u3001\u30e1\u30e2\u30ea\u306e\u4f59\u88d5\u306f\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u4f55\u5341\u6642\u9593\u3082\u8d77\u52d5\u3055\u305b\u305f\u3089\u3001\u3084\u306f\u308a\u843d\u3061\u305d\u3046\u3002<br>\u305d\u306e\u5834\u5408\u306f\u3001cron\u306a\u3069\u3067\u3001\u9069\u6642\u843d\u3068\u3057\u3066\u3001\u518d\u8d77\u52d5\u3055\u305b\u308b\u3088\u3046\u306a\u81ea\u52d5\u5316\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8003\u3048\u3066\u307f\u3088\u3046\u304b\u306a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP\u3092WEB\u3067\u306f\u306a\u304f\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u4f55\u6642\u9593\u3082\u7d99\u7d9a\u7684\u306b\u52d5\u304b\u3059\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u7a3c\u50cd\u3055 &hellip; <a href=\"https:\/\/kamita.net\/program\/?p=463\">Continued<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/kamita.net\/program\/index.php?rest_route=\/wp\/v2\/posts\/463"}],"collection":[{"href":"https:\/\/kamita.net\/program\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kamita.net\/program\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kamita.net\/program\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kamita.net\/program\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=463"}],"version-history":[{"count":3,"href":"https:\/\/kamita.net\/program\/index.php?rest_route=\/wp\/v2\/posts\/463\/revisions"}],"predecessor-version":[{"id":471,"href":"https:\/\/kamita.net\/program\/index.php?rest_route=\/wp\/v2\/posts\/463\/revisions\/471"}],"wp:attachment":[{"href":"https:\/\/kamita.net\/program\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kamita.net\/program\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kamita.net\/program\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}