I encountered a very large project involving Magento and added it as a project to my zend studio. Zend studio would frequently hang with an error related to building workspace. As I suspected, the problem was related to running out of memory as this project is huge. I increased the memory available to Zend Studio with the below solution.
In the Zend Studio interface it is possible to monitor how much Java heap space is used by the application. To do so, enable the option Show heap status in the Zend Studio Preferences by going to Window | Preferences | General (in MacOS X go to Zend Studio | Preferences | General). The heap status now appears in the application’s status bar. If you see that you quickly run out of memory (for example during a project build) you should consider increasing the default Java heap size. This can be done in the file ZendStudio.ini located in the Zend Studio installation path. Search for the –Xms and –Xmx parameters:
Xms – The initial amount of memory to allocate for Java heap space.
Xmx – The maximal amount of memory that is allowed to be used for Java heap space.
These values can be increased, but be aware that you are limited by the physical RAM of the system. Even for very complicated projects 512M Xms and 1024M Xmx should be enough.