hightman / xunsearch

免费开源的中文搜索引擎,采用 C/C++ 编写 (基于 xapian 和 scws),提供 PHP 的开发接口和丰富文档
http://www.xunsearch.com
Other
1.64k stars 391 forks source link

1.4.10使用php脚本建索引会有内存溢出的问题。 #41

Closed herenet closed 7 years ago

herenet commented 7 years ago

PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 2840240 bytes) in /data/wwwroot/www.hongren.com/ThinkPHP/Library/Vendor/Xunsearch/XS.php on line 1379

terryzwt commented 7 years ago

这个你应该可以在 php.ini 或者在索引脚本执行前,手工调大 php 执行内存值.

更好的办法,个人觉得可以分多批更新索引.

herenet commented 7 years ago

查了一下原因,是PHP机制的问题。在递归方法中反复给同一个变量赋值造成内存溢出了。