I would like to know, is there any issues(bad to server) while using ini_set('memory_limit', '-1')
on number of occasions?
The reason why I need to know this is, I'm now working in a project where use of join queries is high. We are only fetch required data's to avoid maximum load but in some situation where data exceeds 20000+ record, execution dies & shows 500 (Internal Server Error)
.
I know Error 500 may be cause of lot other issues, so I have checked it & found the reason was because of PHP execution memory limit exceeding(256M). When I set ini_set('memory_limit', '-1')
on my code, query executed correctly.
The above explanation is just a situation/scenario, no need to consider that & Yes, I agree that using ini_set('memory_limit', '-1')
is a bad practice. So, my question is clearly to know is there any issue on using ini_set('memory_limit', '-1') multiple times on different sections of a project (like sever issues or so). If yes, what are they?