chaiwei Posted May 20, 2010 Share Posted May 20, 2010 Hi, My server mysql database used up to 800mb of memory usage. I have checked through "ps aux" command and restart the mysqld Is it possible because of the slow query? Please advice. Quote Link to comment https://forums.phpfreaks.com/topic/202343-mysql-use-up-to-800mb-of-system-memory/ Share on other sites More sharing options...
Mchl Posted May 20, 2010 Share Posted May 20, 2010 You can limit memory usage by MySQL, although the more memory you give, the batter it runs. MySQL stores open tables in memory so that it doesn't need to do so many disk reads. Quote Link to comment https://forums.phpfreaks.com/topic/202343-mysql-use-up-to-800mb-of-system-memory/#findComment-1060971 Share on other sites More sharing options...
shedokan Posted May 20, 2010 Share Posted May 20, 2010 By what Mchl says, it's not the Sql query that's making it take so much memory but your table is probably very big. Quote Link to comment https://forums.phpfreaks.com/topic/202343-mysql-use-up-to-800mb-of-system-memory/#findComment-1060977 Share on other sites More sharing options...
Mchl Posted May 20, 2010 Share Posted May 20, 2010 It might be a query. For complex queries MySQL creates in-memory temporary tables to store partial results. If query does an unrestricted cross join (or two) these temporary tables can get really big. Quote Link to comment https://forums.phpfreaks.com/topic/202343-mysql-use-up-to-800mb-of-system-memory/#findComment-1060994 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.