最爱红烧肉
- 最爱红烧肉 赞了说说我认为,程序员是最大的亚健康群体,长期久坐,熬夜,颈椎腰椎,心血管非常容易出问题,考虑以后开一家专门服务IT人士的中医诊所。
- 最爱红烧肉 2017-09-20 已签到连续签到1天,获得了5个金钱
- 最爱红烧肉 2017-09-18 已签到连续签到1天,获得了5个金钱
- 最爱红烧肉 2017-09-15 已签到连续签到4天,获得了20个金钱
- 最爱红烧肉 赞了回答
也发现了这个问题,追了源码:
在ErrorHandler类里,有这个变量:
/*** @var integer the size of the reserved memory. A portion of memory is pre-allocated so that * when an out-of-memory issue occurs, the error handler is able to handle the error with * the help of this reserved memory. If you set this value to be 0, no memory will be reserved. * Defaults to 256KB.
*/
public $memoryReserveSize = 262144;/** * Register this error handler */ public function register() { ini_set('display_errors', false); set_exception_handler([$this, 'handleException']); if (defined('HHVM_VERSION')) { set_error_handler([$this, 'handleHhvmError']); } else { set_error_handler([$this, 'handleError']); } if ($this->memoryReserveSize > 0) { $this->_memoryReserve = str_repeat('x', $this->memoryReserveSize); } register_shutdown_function([$this, 'handleFatalError']); }
因为php没有用户主动分配内存的机制,所以,为了内存溢出也能抛出错误,预留了26w个x预先占用了内存。。。
是不是很冷,哈哈 - 最爱红烧肉 2017-09-14 已签到连续签到3天,获得了15个金钱
- 最爱红烧肉 2017-09-13 已签到连续签到2天,获得了10个金钱
- 最爱红烧肉 赞了说说给我32个赞!
- 最爱红烧肉 2017-09-12 已签到连续签到1天,获得了5个金钱