Squeak Daemon: Why doesn't Squeak sleep with zero cpu usage?

Avi Bryant avi at beta4.com
Tue Jan 20 20:54:07 UTC 2004

On Jan 20, 2004, at 12:46 PM, Peter William Lount wrote:

> Hi,
> When squeak (version Squeak3.6g-5420.image) is idle and simply sitting 
> on the screen it's cpu usage drops to hover near 2%. Why? Is there any 
> way to have squeak actually go to sleep? Is this possible even when 
> squeak is listening on network ports? This is important when running 
> multiple copies of squeak on a server. When running 50 copies of 
> squeak idle on a server they consume all the cpu cycles!
> How can I configure (or how can we change) squeak to run as a good 
> "daemon server" citizen?

The simplest and most effective way I've found is to execute "Project 
uiProcess suspend".  Note that this will immediately lock up your UI.  
If you want to save an image in that state, you'll need something like:

[Project uiProcess suspend.  Smalltalk snapshot: true andQuit: true] 

When you reopen that image, it should use much less CPU (but you can 
only interact with it over the network, of course).

You could presumably have a network accessible way of starting the UI 
process going again so that you could 'unlock' that image should you 
need to later.

More information about the Squeak-dev mailing list