Calling system() to invoke a more short-lived PHP script is a potentially effective workaround. Slow, but you didn't choose blazing performance when you chose PHP...
My understanding is that the improved garbage collection in PHP 5.3, which can deal with circular references (cycles), is the real answer. If you get a chance to try PHP 5.3 on your code we'd all learn something from the end result. (: On Thu, Feb 5, 2009 at 1:02 PM, John L. Singleton <[email protected]> wrote: > > Hi Nathanael, > >> Though this sounds like a script to watch your script, it would be >> just >> as easy to create a bash script that listens for your FAM even then >> calls php batch/your_batch_script.php. But if that is non-trivial - a >> complete one stop new script in a different language would be good. >> Though I find long running java processes do tend to do the same thing >> memory wise.. Leave eclipse running for long and its eaten a fair >> chunk >> of memory. > > > I certainly feel what you are saying here: Java can be a hog. But I > don't think it's the case with the size of program I'm talking about > writing. With larger Java stuff you certainly do get into territory > where the garbage collector isn't able to do its thing because you've > kept references around and so forth. However, I've had a lot of luck > with server-side Java in the past... not as a daemon, per se, > > But I kinda like your idea about the script calling a script. The > impression that I got was that PHP doesn't manage its memory well. So > as long as calling system() doesn't leave a bunch of buffers around > every time you call it --- that would probably work. However, I don't > know enough about PHP internals to say what it does with that memory. > > Best, > > JLS > > > > On Feb 4, 2009, at 11:59 PM, Nathanael D. Noblet wrote: > >> >> John L. Singleton wrote: >>> Hi Jacob, >>> >>> Thanks for the response! >>> >>>> I know this isn't what you want to hear but.. >>>> >>>> PHP is an absolutely awful language when it comes to doing anything >>>> but web-related work. Well, it's not the language per-se, it's the >>>> runtime. Even if you figure out how to get your database >>>> connections >>>> reconnected you will run into problems with the PHP garbage >>>> collector. You will have memory leaks that are impossible to fix. >>>> You'll end up coding a script to watch your script. >>> >>> That's good point. I hadn't really considered the memory angle and >>> I'm >>> not opposed to just implementing it in Java. The only issue that >>> kinda, hurm, sucks, is the issue of bypassing my primary persistence >>> layer (Propel). My attempt to code it in PHP was just to keep things >>> in PHP... The idea of having a batch script doing an external task >>> was >>> just a bit too tantalizing, I suppose. But on the plus side, I can >>> ditch FAM, since Java has built in classes for this sort of thing. >>> Some of the processing was in Java anyway, on account of the fact >>> that >>> I'm processing images and Java has superior support for doing non- >>> trivial image manipulation. >> >> Though this sounds like a script to watch your script, it would be >> just >> as easy to create a bash script that listens for your FAM even then >> calls php batch/your_batch_script.php. But if that is non-trivial - a >> complete one stop new script in a different language would be good. >> Though I find long running java processes do tend to do the same thing >> memory wise.. Leave eclipse running for long and its eaten a fair >> chunk >> of memory. >> >> -- >> Nathanael d. Noblet >> T: 403.875.4613 >> >> > > > > > > -- Tom Boutell www.punkave.com www.boutell.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en -~----------~----~----~----~------~----~------~--~---
