简体   繁体   English

MySQL 5.1 memory 处理大量行时泄漏

[英]MySQL 5.1 memory leak when processing large numbers of rows

I have a PHP 5 script which loops through a MySQL table (approx. 600,000 rows), and for each row, maintains approx.我有一个 PHP 5 脚本,它循环通过 MySQL 表(大约 600,000 行),并且对于每一行,维护大约16 other tables of summarised information based on columns on each row of the source table (this is done by checking if the summary row exists, and if so, update it, else insert it).其他 16 个基于源表每行列的汇总信息表(这是通过检查汇总行是否存在来完成的,如果存在,则更新它,否则插入它)。

The problem is that as the process continues, the mysqld.exe process eats up more and more memory until it exhausts the system and crashes the PHP script.问题在于,随着进程的继续,mysqld.exe 进程会消耗越来越多的 memory,直到耗尽系统并使 PHP 脚本崩溃。 The PHP script is not gaining memory, only the mysqld.exe process. PHP 脚本没有获得 memory,只有 mysqld.exe 进程。 In the PHP script, each read from a table is free'd ( $resultset->free() statement) so all should be well.在 PHP 脚本中,从表中读取的每个内容都是免费的( $resultset->free()语句),所以一切都应该很好。

Thanks for the answers - it wasnt MySQL, but a COM call to a third-party driver that was using the memory - my bad:)感谢您的回答 - 它不是 MySQL,而是 COM 对使用 memory 的第三方驱动程序的调用 - 我的错:)

Are you sure you're not hitting the maximum execution time?你确定你没有达到最大执行时间吗? How fast is your query when you execute it directly?当您直接执行查询时,您的查询有多快?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM