Jon Ramsey came up with a continuous integration tool called Rephlux. Rephlux periodically checks out your code from CVS and runs your unit tests on it. It produces a RSS feed of test failures and a RSS feed of CVS revisions. How cool is that?
In the future it should be possible to automatically build releases and documentation when all the tests pass. Hopefully, this will help improve our record of releasing on the WACT project. With one formal release in nearly a year of active development, our record is dismal as Harry diplomatically points out.
Jon is running Rephlux remotely for WACT right now because we are having a problem getting our full test suite to run in the 8M limit that sourceforge imposes on PHP. We have 97 test cases, 541 test functions, and 1927 assertions in our test suite. This will only grow. The full test suite includes over 350 PHP files when it runs.
Since there isn’t much we can do about unincluding files to free up memory, I decided to take a look at the data that gets stored to see if there was any low hanging fruit there. I wanted to look and see if any of the code we are using keeps any data in global variables that it might be able to release when done to allow the space to be garbage collected.
So, I added a quick and dirty little hack to get an idea of the size of the various global variables that were left over after a test run.
foreach (array_keys($GLOBALS) as $key) {
echo "$key=" . strlen(serialize($GLOBALS[$key]));
}
Most of the globals that were left over were tiny, but there was one that stood out. That was something from PEAR:
_PEAR_destructor_object_list=146270
Looking in to this further I found that the PEAR base class registers a rather dubious destructor for every object that inherits from it:
function _PEAR() {
if ($this->_debug) {
printf("PEAR destructor called, class=%sn", get_class($this));
}
}
To support this gem, PEAR puts a reference to every object instance ever instantiated that inherits from
PEAR into the global variable _PEAR_destructor_object_list. There the object stays until the deconstruction shutdown function is called. This reference prevents garbage collection of any of objects inheriting from PEAR or the memory they reference during the lifetime of the script. And it does this for no good reason at all.
I’ve expressed my opinion of pear.php before and this only reinforces it.
The only PEAR module that WACT requires is XML_HTMLSax, a handy parser for HTML with an XML parsing interface. I’ve always been a little bit uncomfortable with its dependency on pear.php and the deployment issues that this introduces into WACT. WACT also has optional components that reference other PEAR packages, such as PEAR::DB, PEAR::MDB and PEAR::MDB2. Fortunately a more typical WACT use case only instantiates a handful of PEAR objects.
Nice discovery
Just started sorting out HTMLSax BTW – it’s now under PHP’s CVS here and have already elimated the PEAR dependancy this example – basically my fault for making assumptions about comment syntax – Word generates bizarre stuff like: <![endif]–>
HTMLSax 3.0.0 is out and PEAR.php is gone (apart from some lazy includes on errors that WACT will never encounter) – updated WACT for the (slightly modified) API. Best make sure you have the latest.
Very nice, Harry!
this issue is fixed in CVS
In the CVS it works fine, its just that in the earlier version people were having problems with it.
But either way, nice!
Jeff…thanks for the ‘memory check hack’. I needed something to make memory usage measurements. Your ‘roll-your-own’ check was very handy indeed.
[...] For reasons explained by Jeff here, we’ve been looking for ways to run WACT’s test suite in a way that won’t run into PHP’s memory limit and the obvious solution is execute the tests in smaller groups over the network, meaning Apache will create a new child for each group, each child having a fresh chunk of memory to gobble up. [...]
Howdy! I know this is kind of off topic but I was wondering which blog platform are you using for this website? I’m getting tired of Wordpress because I’ve had problems with hackers and I’m looking at alternatives for another platform. I would be awesome if you could point me in the direction of a good platform.
I’ve said that least 1207763 times. The problem this like that is they are just too compilcated for the average bird, if you know what I mean
Howdy, i read your blog occasionally and i own a similar one and i was just curious if you get a lot of spam responses? If so how do you reduce it, any plugin or anything you can recommend? I get so much lately it’s driving me mad so any help is very much appreciated.
Thank you for your great post! it has been terribly helpful. I hope that you can continue sharing your information with us.
howdy, i make your diary upon character.it’s actually intelligent codified as a import it helped me copiousness. prolong the substantial work.
This post is very good thanks to the owner of this blog is to be taken
a helpful put up many thanks!
I discovered this post helpful
thanks for this useful put up
hey, it’s ranking until catch sites with google as a import thanks since the divide that you’ve precondition. commonly, i’m really astonished, but etc.
KIDS AND RECIPES…
Only blowing a number of free occasion on Delicious and I discovered this page . Not typically some tips i prefer to understand, however it has been definitely worth time. Many thanks….
Thank you, I have just been searching for information about this topic for ages and yours is the greatest I’ve discovered till now. But, what about the bottom line? Are you sure about the source?
[...]The information mentioned in the article are some of the best available [...]……
[...]The information mentioned in the article are some of the greatest available [...]……
Useful info. Fortunate me I discovered your site unintentionally, and I’m surprised why this accident did not happened earlier! I bookmarked it.
Hello, i think that i saw you visited my website so i came to “return the favor”.I’m trying to find things to improve my site!I suppose its ok to use some of your ideas!!