Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] 1.5Gb PHP process, lots of swap [RSS Feed]

#1 Oct. 28, 2005 20:22:02

Cristiano D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] 1.5Gb PHP process, lots of swap


Is there any way to force a PHP CLI application to free the memory it took
from the system ? I mean, is there any PHP userland or PHP internal
functional call that could *really* free 'the memory allocated by a
variable' or 'the memory allocated but currently not used and waiting for
the script end to be freed' ?

Regards,

Cristiano Duarte

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#2 Oct. 28, 2005 21:24:23

Andi G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] 1.5Gb PHP process, lots of swap


Hi Cristiano,Alex sent a patch to the list a while ago which forces the memoryallocator to return memory to the system. However, in your case, Ithink you might be just having PHP variables "leaking". Can you tryand identify where this info is sitting and try and unset it? It'simportant to dig deeper and/or reproduce in order to understand.Andi

At 12:21 PM 10/28/2005, Cristiano Duarte wrote:Is there any way to force a PHP CLI application to free the memory it took
from the system ? I mean, is there any PHP userland or PHP internal
functional call that could *really* free 'the memory allocated by a
variable' or 'the memory allocated but currently not used and waiting for
the script end to be freed' ?

Regards,

Cristiano Duarte

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#3 Oct. 29, 2005 02:51:01

S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] 1.5Gb PHP process, lots of swap


Lexical variables would be nice.

On 10/28/05, Andi Gutmans <> wrote:
> Hi Cristiano,
>
> Alex sent a patch to the list a while ago which forces the memory
> allocator to return memory to the system. However, in your case, I
> think you might be just having PHP variables "leaking". Can you try
> and identify where this info is sitting and try and unset it? It's
> important to dig deeper and/or reproduce in order to understand.
>
>
> Andi
>
> At 12:21 PM 10/28/2005, Cristiano Duarte wrote:
> >Is there any way to force a PHP CLI application to free the memory it took
> >from the system ? I mean, is there any PHP userland or PHP internal
> >functional call that could *really* free 'the memory allocated by a
> >variable' or 'the memory allocated but currently not used and waiting for
> >the script end to be freed' ?
> >
> >Regards,
> >
> >Cristiano Duarte
> >
> >--
> >PHP Internals - PHP Runtime Development Mailing List
> >To unsubscribe, visit:http://www.php.net/unsub.php>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit:http://www.php.net/unsub.php>
>


--



-------------


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#4 Oct. 29, 2005 06:15:44

Andi G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] 1.5Gb PHP process, lots of swap


What do you mean?

At 06:50 PM 10/28/2005, Sebastian wrote:Lexical variables would be nice.

On 10/28/05, Andi Gutmans <> wrote:
> Hi Cristiano,
>
> Alex sent a patch to the list a while ago which forces the memory
> allocator to return memory to the system. However, in your case, I
> think you might be just having PHP variables "leaking". Can you try
> and identify where this info is sitting and try and unset it? It's
> important to dig deeper and/or reproduce in order to understand.
>
>
> Andi
>
> At 12:21 PM 10/28/2005, Cristiano Duarte wrote:
> >Is there any way to force a PHP CLI application to free the memory it took
> >from the system ? I mean, is there any PHP userland or PHP internal
> >functional call that could *really* free 'the memory allocated by a
> >variable' or 'the memory allocated but currently not used and waiting for
> >the script end to be freed' ?
> >
> >Regards,
> >
> >Cristiano Duarte
> >
> >--
> >PHP Internals - PHP Runtime Development Mailing List
> >To unsubscribe, visit:http://www.php.net/unsub.php>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit:http://www.php.net/unsub.php>
>


--



-------------
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#5 Oct. 29, 2005 07:41:58

S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] 1.5Gb PHP process, lots of swap


Something like the variables produced by perl's my() operator so that
a variable is lexically scoped along with block-level scoping could
help earlier detection of when it's possible to release a variable.
This wouldn't solve leaks, but it might help prevent some

On 10/28/05, Andi Gutmans <> wrote:
> What do you mean?
>
> At 06:50 PM 10/28/2005, Sebastian wrote:
> >Lexical variables would be nice.
> >
> >On 10/28/05, Andi Gutmans <> wrote:
> > > Hi Cristiano,
> > >
> > > Alex sent a patch to the list a while ago which forces the memory
> > > allocator to return memory to the system. However, in your case, I
> > > think you might be just having PHP variables "leaking". Can you try
> > > and identify where this info is sitting and try and unset it? It's
> > > important to dig deeper and/or reproduce in order to understand.
> > >
> > >
> > > Andi
> > >
> > > At 12:21 PM 10/28/2005, Cristiano Duarte wrote:
> > > >Is there any way to force a PHP CLI application to free the memory it
> > > >took
> > > >from the system ? I mean, is there any PHP userland or PHP internal
> > > >functional call that could *really* free 'the memory allocated by a
> > > >variable' or 'the memory allocated but currently not used and waiting for
> > > >the script end to be freed' ?
> > > >
> > > >Regards,
> > > >
> > > >Cristiano Duarte
> > > >
> > > >--
> > > >PHP Internals - PHP Runtime Development Mailing List
> > > >To unsubscribe, visit:http://www.php.net/unsub.php> > >
> > > --
> > > PHP Internals - PHP Runtime Development Mailing List
> > > To unsubscribe, visit:http://www.php.net/unsub.php> > >
> > >
> >
> >
> >--
> >
> >
> >
> >-------------
> >
>
>


--



-------------


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#6 Oct. 29, 2005 19:51:24

Andi G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] 1.5Gb PHP process, lots of swap


Well in most cases, if your program isn't written in the global scopebut has methods or functions, then local variables will be removedearly enough. For situations where you need to force it I suggest touse unset(). It'd be ugly to add another scoping operator and in mostcases it's not needed.Regards,

Andi

At 11:41 PM 10/28/2005, Sebastian wrote:Something like the variables produced by perl's my() operator so that
a variable is lexically scoped along with block-level scoping could
help earlier detection of when it's possible to release a variable.
This wouldn't solve leaks, but it might help prevent some

On 10/28/05, Andi Gutmans <> wrote:
> What do you mean?
>
> At 06:50 PM 10/28/2005, Sebastian wrote:
> >Lexical variables would be nice.
> >
> >On 10/28/05, Andi Gutmans <> wrote:
> > > Hi Cristiano,
> > >
> > > Alex sent a patch to the list a while ago which forces the memory
> > > allocator to return memory to the system. However, in your case, I
> > > think you might be just having PHP variables "leaking". Can you try
> > > and identify where this info is sitting and try and unset it? It's
> > > important to dig deeper and/or reproduce in order to understand.
> > >
> > >
> > > Andi
> > >
> > > At 12:21 PM 10/28/2005, Cristiano Duarte wrote:> > > >Is there any way to force a PHP CLI application to free thememory it took> > > >from the system ? I mean, is there any PHP userland or PHP internal
> > > >functional call that could *really* free 'the memory allocated by a> > > >variable' or 'the memory allocated but currently not usedand waiting for> > > >the script end to be freed' ?
> > > >
> > > >Regards,
> > > >
> > > >Cristiano Duarte
> > > >
> > > >--
> > > >PHP Internals - PHP Runtime Development Mailing List
> > > >To unsubscribe, visit:http://www.php.net/unsub.php> > >
> > > --
> > > PHP Internals - PHP Runtime Development Mailing List
> > > To unsubscribe, visit:http://www.php.net/unsub.php> > >
> > >
> >
> >
> >--
> >
> >
> >
> >-------------
> >
>
>


--



-------------
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

  • Root
  • » PHP
  • » [PHP-DEV] 1.5Gb PHP process, lots of swap [RSS Feed]

Board footer

Moderator control

Enjoy the 18th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support