I've got a quite large website running in centos server. It performs lots of spend instructions and runs lots of MySQL queries. Everything appears fine. Running very well. But in the same moment Apache is utilizing lots of memory continuously. So far as I understand the memory employed by Apache ought to be freed when the script execution is finished but it is nothing like that during my situation.

Is some type of condition in my code which makes Apache utilize more memory or must i be checking other things also?

Regrettably Apache processes will not return memory utilized by mod_php. You need to restart/recycle the Apache processes every now and then. Browse the configuration value MaxRequestsPerChild which is going to do this for you personally instantly (it's off automatically on CentOS basically recall properly).

Place it to something low, although not lacking since recycling is costly. A couple of 100s will most likely do.