php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37412 php does not free script memory after big script execution
Submitted: 2006-05-11 18:42 UTC Modified: 2006-05-11 19:14 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: rafal dot figas at rad-com dot pl Assigned:
Status: Not a bug Package: Apache related
PHP Version: 5.1.4 OS: gentoo
Private report: No CVE-ID: None
 [2006-05-11 18:42 UTC] rafal dot figas at rad-com dot pl
Description:
------------
Similar to bug: 36197

I think that what momo says may be truth. I've experienced similar problem. I do not now is it PHP problem or APACHE problem. Description:

I have a big script operating on tables and objects. It needs aprox. 100MB of memory. Apache allocates memory. Script executes and finishes. Memory is still reserved. Apache really keeps memory reserved "for future use", but(!) here comes problem: I have a MaxFreeMem directive set in apache config to 1KB! So as Apache documentation says it should be freed instantly after script execution finishes (because it is unused) but it doesn't. Either there is bug in Apache (can't check) or PHP does not frees used memory, and apache does not know that it is free. Please, simply check this problem, because for big scripts it makes my machines crash. My version was exactly 5.1.2 (now it is 5.1.4 and the problem remains) and OS is gentoo. Best regards.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-11 18:55 UTC] tony2001@php.net
Please read what Ilia said in the last comment to bug #36197.
 [2006-05-11 19:09 UTC] rafal dot figas at rad-com dot pl
Sorry for re-opening bug. If u think I'm not right comment and bogus it and I'll let him die.

OK, I've already read that and I understand, but I have "MaxFreeMem" directive in apache (I'm using mod_php). And that makes me wonder... Are you saying that this is proper behaviour of apache?

I've just noticed that reloading apache causes it to free the memory... Another strange behaviour.

And another strange thing - after a few consecutive executions server starts swapping. It's not normal when apache has 1GB of free memory teoreticaly.
 [2006-05-11 19:14 UTC] tony2001@php.net
It has nothing to do with Apache and/or PHP.
This is how Linux memory manager works.
Yes, and swapping is not related to PHP in any way either.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 17:01:29 2024 UTC