admin管理员组文章数量:1323035
I think the answer to this question is no but I do not have anymore leads of the problem I am trying to figure out.
I initially had a single script that did some database queries via SQLCMD. I have now decided to initiate this script via AJAX and wait for the response. But I get a fatal error of:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 445 bytes) in C:\process_txt.php on line 109
The only new thing that I have changed in my script is this ajax request and nothing else to be honest which is why I have asked this question.
I use JQuery AJAX request and I don't think I am using polling. Here is an example AJAX GET request that I make use of:
function process_txt(checkbox){
waiting = 1;
var folder_path = $('#folder_path').val();
var file_name = $('#'+ checkbox + '_val').val();
$.get("process_txt.php", { path: folder_path, file: file_name},
function(data){
alert(data);
});
}
Thanks to anyone that can try to shed some light on this matter and not the problem I am having, just this question! :)
I think the answer to this question is no but I do not have anymore leads of the problem I am trying to figure out.
I initially had a single script that did some database queries via SQLCMD. I have now decided to initiate this script via AJAX and wait for the response. But I get a fatal error of:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 445 bytes) in C:\process_txt.php on line 109
The only new thing that I have changed in my script is this ajax request and nothing else to be honest which is why I have asked this question.
I use JQuery AJAX request and I don't think I am using polling. Here is an example AJAX GET request that I make use of:
function process_txt(checkbox){
waiting = 1;
var folder_path = $('#folder_path').val();
var file_name = $('#'+ checkbox + '_val').val();
$.get("process_txt.php", { path: folder_path, file: file_name},
function(data){
alert(data);
});
}
Thanks to anyone that can try to shed some light on this matter and not the problem I am having, just this question! :)
Share Improve this question asked Jan 29, 2010 at 14:12 AbsAbs 58k103 gold badges282 silver badges417 bronze badges 3- No, your error es from PHP. Ajax makes a normal HTTP request. Post your PHP code. ;) – Pik' Commented Jan 29, 2010 at 14:17
- I will start a new question for this, I think I have identified the problem but don't know how too rewrite the code. – Abs Commented Jan 29, 2010 at 14:22
- Check your PHP code. Maybe you include some libs that help you generate responce for ajax/http request? – NilColor Commented Jan 29, 2010 at 14:24
3 Answers
Reset to default 12AJAX vs a regular call will make no difference to the server. As far as PHP is concerned, nothing will have changed - the request is just a request, regardless of how it was initiated from the client.
I'd look for the source of your memory leak elsewhere - perhaps the processor can get in an infinite loop if certain parameters are specified?
In the context of PHP memory: Using AJAX is the same as not using AJAX, but as a result of using AJAX you can output less data back to the user in the HTTP response, which makes PHP to use less memory.
No. The requests from JS and browser's address bar are the same. Oh wait, JSON/XML is less bytes than HTML! So it's better.
Look at your PHP code - maybe there's some bugs in database queries.
本文标签: javascriptDoes the use of AJAX increase memory usage of PHPStack Overflow
版权声明:本文标题:javascript - Does the use of AJAX increase memory usage of PHP? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742109412a2421174.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论