WP_Query with 4 post meta field arguments gives 500 internal server error

I found solution to my problem by replicating the whole setup to my local server. Everything worked fine query executed normally. And the bug was memory allocated for PHP execution which i come to know by comparing the local and live server. So for that I declared two lines in the header part of the file.

set_time_limit(0);
ini_set("memory_limit", "1024M");