Date: 01/10/01
- Next message: Stanislav Malyshev: "Re: [PHP-DEV] PHP4: php_module holds memory to long !"
- Previous message: Stanislav Malyshev: "Re: [PHP-DEV] PHP4: php_module holds memory to long !"
- In reply to: Sascha Schumann: "Re: [PHP-DEV] PHP4: php_module holds memory to long !"
- Next in thread: Stanislav Malyshev: "Re: [PHP-DEV] PHP4: php_module holds memory to long !"
- Reply: Stanislav Malyshev: "Re: [PHP-DEV] PHP4: php_module holds memory to long !"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
The answer is really not so easy.
I have RedHat Linux 6.2 (with standard kernel, I suppose 2.1).
I tried such program in c++:
//File mall.cc
#include <alloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main() {
void* v[1000];
for (int i=0;i<1000;i++) {
v[i]=malloc(100000);
//printf("%i. %p; ",i,v[i]);
memset(v[i],i,10000);
}
printf("\n\nMemory allocated. Wait 20 s.\n");
sleep(20);
for (int i=0;i<1000;i++) {
free(v[i]);
//printf("%i. ^; ",i,v[i]);
}
printf("\nMemory freed. Wait 20 s.\n");
sleep(20);
}
Then I examine it with 'top' command (then shift-M to sort by memory
usage).
In first 20 seconds process 'mall' is on the top with 13M, then
in next 20 s it is NOT.
And here is the basic difference between 'mall' and 'httpd' processes: the
last are on the top ALL THE TIME.
So ?
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Stanislav Malyshev: "Re: [PHP-DEV] PHP4: php_module holds memory to long !"
- Previous message: Stanislav Malyshev: "Re: [PHP-DEV] PHP4: php_module holds memory to long !"
- In reply to: Sascha Schumann: "Re: [PHP-DEV] PHP4: php_module holds memory to long !"
- Next in thread: Stanislav Malyshev: "Re: [PHP-DEV] PHP4: php_module holds memory to long !"
- Reply: Stanislav Malyshev: "Re: [PHP-DEV] PHP4: php_module holds memory to long !"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

