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

2007-05-11 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

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

2007-05-11 Thread Lionel MARTIN
Hi Perrin, No, if the message you're getting is to use globals instead of lexicals then you've got it all wrong. - Use lexicals for everything, unless you actually want the value to persist across requests. I was thinking, for large amounts of data, about using globals. Indeed, imagine you

merging multiple tmon.out files

2007-05-11 Thread John ORourke
Hi folks, Recently I needed to track down some slow page-load times on a production server, so I took the performance hit and stuck Devel::DProf on it for a few hours, but then had to get an overall picture. So I wrote a little script to merge multiple tmon.out files - help yourselves:

Apache::DProf missing some subroutines

2007-05-11 Thread John ORourke
Hi folks, Any idea why Apache::DProf would be failing to list some subroutines that are definitely being called, in the tmon.out file? I grepped all sub references from tmon.out and it's listing my method handlers, it's listing some of my constructors, and its listing some object methods,

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

2007-05-11 Thread Michael Peters
Lionel MARTIN wrote: - Don't load large amounts of data into scalars. Fine. Now I know why. But sometimes, you don't have the choice. I'd like to know what situations you encounter where you are forced to load large amounts of data into scalars. I can't think of any. -- Michael Peters

Re: Apache::DProf missing some subroutines

2007-05-11 Thread Geoffrey Young
John ORourke wrote: Hi folks, Any idea why Apache::DProf would be failing to list some subroutines that are definitely being called, in the tmon.out file? I grepped all sub references from tmon.out and it's listing my method handlers, it's listing some of my constructors, and its listing

Re: Apache::DProf missing some subroutines

2007-05-11 Thread Jeff
Not sure if its relevant, but from general Perl usage, Devel::Profiler often fails to properly recognise function names if its USE statement ends up being executed before your classes have been USEd. If you use factories to instantiate objects from calculated class names, those methods

Re: Apache::DProf missing some subroutines

2007-05-11 Thread Geoffrey Young
Jeff wrote: Not sure if its relevant, but from general Perl usage, Devel::Profiler often fails to properly recognise function names if its USE statement ends up being executed before your classes have been USEd. If you use factories to instantiate objects from calculated class names,

Re: Apache::DProf missing some subroutines

2007-05-11 Thread Jeff
Original Message Subject: Re:Apache::DProf missing some subroutines From: Geoffrey Young [EMAIL PROTECTED] CC: modperl modperl@perl.apache.org Date: 11 May 2007 14:11:14 Also, Devel::Profiler can't handle many of the DBI implementations (you have to bad_pkgs=[] them. I

Re: Apache::DProf missing some subroutines

2007-05-11 Thread Geoffrey Young
Jeff wrote: Original Message Subject: Re:Apache::DProf missing some subroutines From: Geoffrey Young [EMAIL PROTECTED] CC: modperl modperl@perl.apache.org Date: 11 May 2007 14:11:14 Also, Devel::Profiler can't handle many of the DBI implementations (you have to

Re: few newbie quesitons..

2007-05-11 Thread James. L
i still have few questions, would you please answer them for me? see below.. --- Perrin Harkins [EMAIL PROTECTED] wrote: On 5/7/07, James. L [EMAIL PROTECTED] wrote: the files i need to parse are usually in size of 2M - 10M. will the mod_perl server(2G Mem) use up the memory pretty quick

Re: Apache::DProf missing some subroutines

2007-05-11 Thread Geoffrey Young
John ORourke wrote: Geoffrey Young wrote: Jeff wrote: Not sure if its relevant, but from general Perl usage, Devel::Profiler often fails to properly recognise function names if its USE statement ends up being executed before your classes have been USEd. yes, because

RFC: Devel::Profiler::Plugins::Template

2007-05-11 Thread Geoffrey Young
hi all :) I spent some time this week adding hooks for template toolkit into Devel::Profiler. you can find the code here http://www.modperlcookbook.org/~geoff/modules/experimental/Devel-Profiler-Plugins-Template-0.01.tar.gz I'm not entirely convinced of the namespace, which is why it's not on

Re: Apache::DProf missing some subroutines

2007-05-11 Thread Perrin Harkins
On 5/11/07, John ORourke [EMAIL PROTECTED] wrote: Any idea why Apache::DProf would be failing to list some subroutines that are definitely being called, in the tmon.out file? Yes. You're probably loading some of your code before initializing the debugger. Put something like this in

Re: Apache::DProf missing some subroutines

2007-05-11 Thread John ORourke
Geoffrey Young wrote: Jeff wrote: Not sure if its relevant, but from general Perl usage, Devel::Profiler often fails to properly recognise function names if its USE statement ends up being executed before your classes have been USEd. yes, because Devel::Profiler scans for then during

Re: few newbie quesitons..

2007-05-11 Thread Andy Armstrong
On 11 May 2007, at 15:31, James. L wrote: here is my understand and please verify. say i have sub parse { return $array_ref_contain_the_data } does that memory used by the $array_ref_contain_the_data can be reused by other mod_perl application too? or it is used only by the particular

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

2007-05-11 Thread Perrin Harkins
On 5/11/07, Lionel MARTIN [EMAIL PROTECTED] wrote: For example, instead of using a my $bigdata in 50 different script, that could this result in big memory allocation, I would use a unique $mypack::bigdata in each script, so that each script would share the same memory address for this

Re: few newbie quesitons..

2007-05-11 Thread Perrin Harkins
On 5/11/07, James. L [EMAIL PROTECTED] wrote: even if i am using an iterator object and call it.next in TT, doesn't TT actually keep the rendered template page into one variable and dump it to the browser? in that case, the memory consumed is still equal to the entire size of the data and

Re: Apache::DProf missing some subroutines

2007-05-11 Thread John ORourke
Perrin Harkins wrote: On 5/11/07, John ORourke [EMAIL PROTECTED] wrote: Any idea why Apache::DProf would be failing to list some subroutines that are definitely being called, in the tmon.out file? Yes. You're probably loading some of your code before initializing the debugger. Put something

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

2007-05-11 Thread Lionel MARTIN
Hi again, If you have a lot of scripts that, for example, load large data files, make a module with a sub that you call to load the files and use it from all your scripts. Pass the data by reference to the calling scripts. Then you will isolate the large lexical in that one module. Better

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

2007-05-11 Thread Lionel MARTIN
Lionel MARTIN wrote: - Don't load large amounts of data into scalars. Fine. Now I know why. But sometimes, you don't have the choice. I'd like to know what situations you encounter where you are forced to load large amounts of data into scalars. I can't think of any. I don't have any

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

2007-05-11 Thread Andy Armstrong
On 11 May 2007, at 17:57, Lionel MARTIN wrote: Lionel MARTIN wrote: - Don't load large amounts of data into scalars. Fine. Now I know why. But sometimes, you don't have the choice. I'd like to know what situations you encounter where you are forced to load large amounts of data into

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

2007-05-11 Thread Michael Peters
Lionel MARTIN wrote: Lionel MARTIN wrote: - Don't load large amounts of data into scalars. Fine. Now I know why. But sometimes, you don't have the choice. I'd like to know what situations you encounter where you are forced to load large amounts of data into scalars. I can't think of any.

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

2007-05-11 Thread Michael Peters
Lionel MARTIN wrote: I'll see what I can do when the problem arises, but of course, I now know I should better avoid loading too much data in RAM at once, because of data persistance. Not to be too picky, but just so it's clear to everyone and to future readers of the archives: The issue

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

2007-05-11 Thread Clinton Gormley
That's not really large data -- you're talking about dealing with 10-300k per request ( it should never go beyond that, because you'd be chunking stuff off the db for ease of download to the end user ). I've been under the impression ( and I'd imagine that others on this list are as

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

2007-05-11 Thread Lionel MARTIN
Hi, I think you got me wrong. My initial question was basically something like how could I preserve/give back memory if needed (i.e. in rare situations) and the reply turned up into a don't use large scalars. (which is relevant, I agree, but was not directly replying my initial question)

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

2007-05-11 Thread Clinton Gormley
Obviously, for the second case, I'm assuming that you would do these things on a small percentage of your total requests, otherwise killing off your child would be a major bottleneck. Here, as well, killing a child process under Windows, means killing my whole Apache server (and so

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

2007-05-11 Thread Lionel MARTIN
(sorry, I posted the message below from another email address hours ago, and it didn't get publish - see below if anyone could reply) 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

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

2007-05-11 Thread Lionel MARTIN
-another example hat comes to my mind is a project (implemented in PHP) where I had to work. Part of the process was retrieving cached HTML template pages from the server and do BB tags parsing before serving the client. Of course, you would tell me that I could retrieve the data chunk by

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

2007-05-11 Thread Andy Armstrong
On 11 May 2007, at 19:07, Lionel MARTIN wrote: -another example hat comes to my mind is a project (implemented in PHP) where I had to work. Part of the process was retrieving cached HTML template pages from the server and do BB tags parsing before serving the client. Of course, you would

Re: few newbie quesitons..

2007-05-11 Thread James. L
--- Perrin Harkins [EMAIL PROTECTED] wrote: On 5/11/07, James. L [EMAIL PROTECTED] wrote: even if i am using an iterator object and call it.next in TT, doesn't TT actually keep the rendered template page into one variable and dump it to the browser? in that case, the memory consumed

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

2007-05-11 Thread James. L
--- Perrin Harkins [EMAIL PROTECTED] wrote: 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

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

2007-05-11 Thread Kiran.Nadgir
Can you guys please tell me how to unsubscribe.. I've tried all means but have been unable to. Thanks, Kiran -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Perrin Harkins Sent: Friday, May 11, 2007 6:05 PM To: James. L Cc: modperl@perl.apache.org Subject:

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

2007-05-11 Thread James. L
--- Perrin Harkins [EMAIL PROTECTED] wrote: On 5/11/07, James. L [EMAIL PROTECTED] wrote: 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

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

2007-05-11 Thread Perrin Harkins
On 5/11/07, James. L [EMAIL PROTECTED] wrote: sorry, i wasn't clear. I understand that memory allocated by a lexical variable(not reference) can be released to perl. as described by the practical modperl link you posted. I would expect that both behave the same however you are saying a

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

2007-05-11 Thread Kiran.Nadgir
Why am I getting these emails even after unsubscribing? -Original Message- From: [EMAIL PROTECTED] on behalf of Perrin Harkins Sent: Fri 5/11/2007 8:53 PM To: James. L Cc: modperl@perl.apache.org Subject:Re: After retrieving data from DB, the memory doesn't seem to

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

2007-05-11 Thread Joe Schaefer
[EMAIL PROTECTED] writes: Why am I getting these emails even after unsubscribing? I unsubscribed this person. -- Joe Schaefer