title: Mysql "memory usage" increasing and increasing
body: <p>I have a really big website built old fashioned with PHP &amp; MYSQL.</p>
  
  <p>I have more than 1,000 different queries in my website, on different PHP pages, and it's really hard to update all of them to MYSQLI.</p>
  
  <p>I bought VPS server with 4GB RAM and in the past months I experience really slow page loads.</p>
  
  <p>When I restart my server, everything runs smoothly, but after couple of hours/days the website is getting muchu slower with loading time of 3+ seconds for a page load. I notice that the <strong>mysqld</strong> service is increasing and increasing in memory usage, from 80MB on server restart it reached about 400MB and more of usage.</p>
  
  <p>I put in the end of my index.php mysql_close() but it seem like the connection number still increasing.</p>
  
  <p><strong>Questions</strong>
  What can cause unlimited increment in mysql memory usage?
  Updating all my queries to MYSQLI may improve the performance?</p>
  
  <p>Some information:</p>
  
  <pre><code>innodb_version
  5.5.31
  protocol_version
  10
  slave_type_conversions
  version
  5.5.31-log
  version_comment
  MySQL Community Server (GPL)
  version_compile_machine
  x86_64
  version_compile_os
  Linux
  </code></pre>
  
  <p>storage engine: Mixed (Somes tables are INNODB,some tables are MyISAM.
  my.cnf:</p>
  
  <pre><code>[mysqld]
  datadir=/var/lib/mysql
  socket=/var/lib/mysql/mysql.sock
  user=mysql
  max-connections=100000
  # Disabling symbolic-links is recommended to prevent assorted security risks
  symbolic-links=0
  thread_cache_size=5
  table_open_cache=99390
  sort_buffer_size=512M
  read_rnd_buffer_size=512M
  query_cache_size=512M
  query_cache_limit = 16M
  query_cache_type = 1
  slow_query_log=1 
  slow_query_log_file=slow_query_log.log # 
  long_query_time=5
  log-queries-not-using-indexes=1
  
  
  [mysqld_safe]
  log-error=/var/log/mysqld.log
  pid-file=/var/run/mysqld/mysqld.pid
  </code></pre>
  
  <p>I have about ~6-7 queries running when I use <code>show processlist</code></p>