I'm experiencing the same problem.
It's not related to v0.2-beta, as I had it with at least the previous two roundcube.net announced releases.
It's not related to apache/php version or configuration as I can see the problem still exists in configurations ranging from php 4.3 as apache 1.3.33 module to php 5.2 ran in (fast)cgi mode through lighttpd 1.4.19.
The latest configuration that still experiences the problem is:
php through FastCGI: PHP 5.2.6-0.dotdeb.1 with Suhosin-Patch 0.9.6.2 (cgi-fcgi) (built: May 15 2008 12:52:11)
lighttpd: 1.4.19 built from source.
roundcube: v0.2-beta
From my observations all the php5-cgi processes that start eating as much CPU as they can have gotten to net state CLOSE_WAIT(1) while talking to the IMAP server. At least on that particular box those processes can't be straced at all, strace just can't attach to the process.
IMAP server that Roundcube is talking to is Nginx in proxy mode which in turn is talking to courier imap behind the scenes.
Seeing this makes me thing the problem lies in the imap library (imap.inc) that Roundcube borrowed from IlohaMail and didn't used the standard php imap functions.
While checking Roundcube's mailing lists I've stumbled upon a user submitted patch(2) against imap.inc that tries to fix the above-mentioned-like problem. Unfortunately it led to no success in my situation.
1.
SUMMARY: How to break CLOSE_WAIT2.
Re: [RCD] More info: httpd using 100% cpu...