Archive for May, 2007

Java File Descriptor Leak

Thursday, May 31st, 2007

I’ve encountered issues similar this bug:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6246565
and have found some other bug entries in the past that seem to cover the same problem.

If I’m running a lot of Runtime.getRuntime().exec() or Axis SOAP calls java open several pipes associated with each exec or SOAP call, that especially under a heavily loaded system, can take a very long time to be garbage collected. This has lead to a case where this code hits the default 1024 open file limit in a case where only maybe 20 or 30 files should be open at a time. The solution thus far has been be more careful about opening sockets and pipes in Java, but I have yet to find a better solution. I’m still running Java 5 JDK 1.5 and many of the bug entries seem to recommend upgrading to Java 6.

Offline usage of PHP PEAR packages

Wednesday, May 30th, 2007

Reading through the documentation on PEAR, I was stumped as to how to add a channel offline. Running:

pear channel-discover pear.symfony-project.com

Would try to download http://pear.symfony-project.com/channel.xml which happened to be down for the weekend. Desperately I could not figure out how to make channel-discover read from a file. But then I finally figured out this:

pear channel-add channel.xml

Will do the trick. After running wget http://pearn.symfony-project.com/channel.xml to download the xml file you can then add it offline with the above command. To install the package offline:

pear install symfony-1.02.tgz

After you have downloaded the PEAR package as a tgz file.