Re: Determining system resources
| From: | Robin Getz | Date: | Thu, 04 Nov 2004 17:58:37 +0000 |
| Subject: | Re: Determining system resources | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-201204@lists.php.net to get a copy of this message | ||
Francisco M. Marzoa Alonso [fmmarzoa@gmx.net] wrote:
As far as you cannot lock another processes in the system, so this will not give you the security that the resources will not change -and probably they'll do it- while you're trying to download that file.Yes, I understand, but not to know even if you are in the right order of magnitude, is kind of scary isn't it? For example on my system, I have 1 Gig of physical memory, and 3Gig of swap. If I end up with only 512k free - something is very wrong, and I should disallow functions I know that eat up memory. There is a low probability that multiple connections will pass the test, and then consume the memory, so yes this is not 100% coverage. Maybe what I am seeing is actually a bug in the way that readfile() handles low memory situations. If there is not enough memory for internal functions to run, they should error, not crash your system. I assume that the way the converstation is moved is that there is not a way to see what free system memory is, without calling a command line function (free or mem). -Robin