Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Lionel MARTIN
I would even say PER THREAD or PER PERL INTERPRETER. Indeed, I'm running Per/mod perl under Windows, and there's one unique Apache process (except the parent one) hosting all perl interpreters. Something to ask about modperl and memory in Windows. I know modperl uses threads in Windows. But do

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Perrin Harkins
On 5/10/07, Lionel MARTIN <[EMAIL PROTECTED]> wrote: If my website is made of hundreds of different pages, then, I should better ensure that lexical variables are properly freed up. Even if that's not good programming practive, at least, with global variables, we are sure that the same memory lo

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Foo JH
I would even say PER THREAD or PER PERL INTERPRETER. Indeed, I'm running Per/mod perl under Windows, and there's one unique Apache process (except the parent one) hosting all perl interpreters. Something to ask about modperl and memory in Windows. I know modperl uses threads in Windows. But

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Jonathan Vanasco
On May 10, 2007, at 6:52 PM, Andy Armstrong wrote: On 10 May 2007, at 23:48, Jonathan Vanasco wrote: that also means that variables are sticky -- if you change something from $a= "b" to $a.= "b" , you'll see the var appending b on every iteration No you don't: sub frog { my $x;

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Lionel MARTIN
Thanks for this. well, to complicate things, this behavior is PER CHILD... meaning: if you run test1.pl 2x and they are both served by the same apache child, then the memory will be reused. if you run test1.pl 2x and they are both served by the different apache children, then the memory wi

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Andy Armstrong
On 10 May 2007, at 23:48, Jonathan Vanasco wrote: that also means that variables are sticky -- if you change something from $a= "b" to $a.= "b" , you'll see the var appending b on every iteration No you don't: sub frog { my $x; $x .= 'x'; return $x; } print frog(),

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Jonathan Vanasco
On May 10, 2007, at 6:25 PM, Lionel MARTIN wrote: So, to sum up, if I have got 10 different scripts in a mod perl environment (let's call them test1.pltest10.pl), and using lexical variables there. If I first run test1.pl and then, run test2.pl, the only way for test2.p to get access to

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Lionel MARTIN
- Original Message - From: "Andy Armstrong" <[EMAIL PROTECTED]> To: "Lionel MARTIN" <[EMAIL PROTECTED]> Cc: Sent: Friday, May 11, 2007 12:34 AM Subject: Re: After retrieving data from DB, the memory doesn't seem to be freed up On 10 May 2007, at 23:25, Lionel MARTIN wrote: OK, f

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Lionel MARTIN
OK, fine. That's something important to know then. If my website is made of hundreds of different pages, then, I should better ensure that lexical variables are properly freed up. Even if that's not good programming practive, at least, with global variables, we are sure that the same memory

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Andy Armstrong
On 10 May 2007, at 23:25, Lionel MARTIN wrote: OK, fine. So, to sum up, if I have got 10 different scripts in a mod perl environment (let's call them test1.pltest10.pl), and using lexical variables there. If I first run test1.pl and then, run test2.pl, the only way for test2.p to get

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Perrin Harkins
On 5/10/07, Lionel MARTIN <[EMAIL PROTECTED]> wrote: So, to sum up, if I have got 10 different scripts in a mod perl environment (let's call them test1.pltest10.pl), and using lexical variables there. If I first run test1.pl and then, run test2.pl, the only way for test2.p to get access to th

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Lionel MARTIN
OK, fine. So, to sum up, if I have got 10 different scripts in a mod perl environment (let's call them test1.pltest10.pl), and using lexical variables there. If I first run test1.pl and then, run test2.pl, the only way for test2.p to get access to the memory used by test2.pl is freeing up t

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Perrin Harkins
On 5/10/07, Lionel MARTIN <[EMAIL PROTECTED]> wrote: > There's really no difference in the way globals behave under mod_perl. > You just don't notice it under CGI because the process quits right > after the request has been served. [...] So, this clearly shows that the global variables sticks i

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Andy Armstrong
On 10 May 2007, at 22:59, Lionel MARTIN wrote: I would have believed the same, and that's why I believed that $tmp = [0..10]; followed by $tmp = 1; would free memory (no more reference to the anonymous array), but Perrin is telling me this is not the case. Perl hangs on to the memory u

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Andy Armstrong
On 10 May 2007, at 23:00, Tom Schindl wrote: Right: http://www.nntp.perl.org/group/perl.perl5.porters/2006/03/ msg111095.html Yeah, that's lexicals - not things referred to by lexicals. The example was a reference to an array. -- Andy Armstrong, hexten.net

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Lionel MARTIN
-I'll try to use, in my Perl scripts, lexical variables instead of global variables, so that I'm sure the used memory can be resued for later requests (global variables, on the other hand, stick in memory, due to mod perl way of operating) Not really. In terms of memory, there's no differenc

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Lionel MARTIN
When the array goes out of scope its reference count is decremented. If the reference count goes to zero (implying there are no more references) the memory is released. I would have believed the same, and that's why I believed that $tmp = [0..10]; followed by $tmp = 1; would free memor

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Tom Schindl
Right: http://www.nntp.perl.org/group/perl.perl5.porters/2006/03/msg111095.html Tom Perrin Harkins schrieb: On 5/10/07, Andy Armstrong <[EMAIL PROTECTED]> wrote: Unless I'm misunderstanding you that's not true. When a value's reference count goes to zero the memory is freed - at least to Perl

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Perrin Harkins
On 5/10/07, Andy Armstrong <[EMAIL PROTECTED]> wrote: Unless I'm misunderstanding you that's not true. When a value's reference count goes to zero the memory is freed - at least to Perl if not to the OS. No, it's not. I know it's counter-intutive, but this is a feature of Perl, and the behavio

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Perrin Harkins
On 5/10/07, Lionel MARTIN <[EMAIL PROTECTED]> wrote: -I'll try avoid using large chunks of data so that interpreters memory footprint don't grow too big. Yes. -I'll try to use, in my Perl scripts, lexical variables instead of global variables, so that I'm sure the used memory can be resued fo

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Andy Armstrong
On 10 May 2007, at 22:30, Lionel MARTIN wrote: No. Those are two different things. If you explicitly undef it, the memory gets handed back to Perl: undef $foo; If it just goes out of scope, the memory stays allocated to that variable. Unless I'm misunderstanding you that's not true. When

Re: problems with Makefile.PL for libapreq 1.33

2007-05-10 Thread Michael Peters
Marius Feraru wrote: > Michael Peters wrote: >> Weird. This seems to have been a problem that was noticed in 2005 and Stas >> recommended almost the exact same patch. >> http://mail-archives.apache.org/mod_mbox/perl-modperl/200505.mbox/[EMAIL >> PROTECTED] > >> Any reason this wasn't applied then

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Lionel MARTIN
Hi, I can see this is a very complex topic, that would require me to delve into Perl C surce code in order to really understand what's going on behind the scenes. So, for now, I'll limit myself to these strategies (and please tell me if I'm wrong): -I'll try avoid using large chunks of data

Re: problems with Makefile.PL for libapreq 1.33

2007-05-10 Thread Marius Feraru
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Michael Peters wrote: > Weird. This seems to have been a problem that was noticed in 2005 and Stas > recommended almost the exact same patch. > http://mail-archives.apache.org/mod_mbox/perl-modperl/200505.mbox/[EMAIL > PROTECTED] > > Any reason this

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Perrin Harkins
On 5/10/07, Lionel MARTIN <[EMAIL PROTECTED]> wrote: On Windows XP, it seems to me that Perl never gves back memory to the OS, even after I undef variables or after they go out of scope. That's pretty common. Perl will be able to use the memory for other variables though. But then, I'm wonde

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Lionel MARTIN
Hi Perrin, Thanks for your reply. On Windows XP, it seems to me that Perl never gves back memory to the OS, even after I undef variables or after they go out of scope. For example, I can see it with this code: use strict; print "Step 1\n"; ; my $x = 'a'x10**7; print "Step 2\n"; ; $x = undef;

Re: Perl module for cookie/logon/session management with Apache

2007-05-10 Thread Perrin Harkins
On 5/10/07, Igor Chudov <[EMAIL PROTECTED]> wrote: I am looking for modules above the level of Apache::Session. Something that would let me have a website with logon/passwords/user status in request/etc without doing more than one or two calls to a module, and maybe providing access to the SQL ac

Perl module for cookie/logon/session management with Apache

2007-05-10 Thread Igor Chudov
I am looking for modules above the level of Apache::Session. Something that would let me have a website with logon/passwords/user status in request/etc without doing more than one or two calls to a module, and maybe providing access to the SQL accounts table and a logon form. My situation is that

Re: problems with Makefile.PL for libapreq 1.33

2007-05-10 Thread Michael Peters
Michael Peters wrote: > The attached patch should fix this problem in Makefile.PL by doing the test > for > mod_perl version before the test for Apache::Test. Weird. This seems to have been a problem that was noticed in 2005 and Stas recommended almost the exact same patch. http://mail-archives

problems with Makefile.PL for libapreq 1.33

2007-05-10 Thread Michael Peters
This is kind of convoluted, but bare with me: I have Apache2/mod_perl2 and Apache::Test installed on my system (FC6) in the standard locations. I now want to install Apache1/mod_perl1 and libapreq 1.33 in a separate location that doesn't have Apache::Test. Now running Makefile.PL in for libapreq (

Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Perrin Harkins
On 5/10/07, Lionel MARTIN <[EMAIL PROTECTED]> wrote: I suspect that this is coming from data retrieved from my DB not being well freed. That's right. There are two things you need to understand here. The first is that Perl doesn't free memory from variables unless you tell it to, even when th

RE: make test failes for mod_perl 2.0.3 and apache 2.2.4

2007-05-10 Thread Elad Golan
Hello, Sorry if this was posted twice, I can't see the original post . I am trying to install mod_perl 2.0.3 on a unix station with solaris10 : SunOS cobar 5.10 Generic_118833-03 sun4u sparc SUNW,Ultra-60 I have apache 2.2.4 installed on my station . my perl version is v5.8.0 built for sun4-

Re: Odd problem

2007-05-10 Thread Raf
Hi Doc, On Tue, 8 May 2007, The Doctor wrote: I am trying to compile the most recent version of mod_perl 2 however once install, Apache says it cannot find the so even tough it is there. Pointers please. The LoadModule can point to a module either relative to your ServerRoot or it can be a

After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Lionel MARTIN
Hi, I am running an Apache 2.059 server, on a Win32 platform (Perl 5.8 & mod_perl 2.03). During the lifetime of the server, I cn see that the memory footprint of the Apache process is getting bigger and bigger, so I would like to understand why. I can't say this is really a problem, but I woul