Image using high CPU in WeakIdentityKeyDictionary>>scanFor:

Ross Boylan RossBoylan at stanfordalumni.org
Mon Sep 19 20:26:46 UTC 2005


I continue to have major problems with squeak taking up all the CPU
and becoming extraordinarily sluggish (e.g., 15 seconds to respond to
click, minutes to complete some operations).

A TimeProfile while the system was doing nothing showed virtually all
(99.4%) the time going to WeakIdentityDictionary>>scanFor:.  This time
is roughly evenly split between primitives and
WeakKeyAssociation>>key.

Highpoints of the stack (sorry, there doesn't seem to be a good way to
copy or fileout the whole thing) with "..." indicating omissions:
PasteUpMorph>>doOneCycle
...
SystemWindow>>stepAt:
TimeProfileBrowser(Object)>>stepAt:in:
...
TimeProfileBrowser(Object)>>updateListsAndCodeIn:
...
TimeProfileBrowser(Object)>>canDiscardEdits
SystemWindow(Object)>>canDiscardEdits
...
SystemWindow(Object)>>myDependents
WeakIdentityKeyDictionary(Dictionary)>>at:ifAbsent:
WeakIdentityKeyDictionary(Set)>>findElementOrNil:
WeakIdentityKeyDictionary>>scanFor

Memory activity and GC looks minimal.

Does anyone have any idea about what the deeper cause of this problem
might be, or where to look.  Even better if you have a solution :)

The problem with the VM taking up lots of CPU and not responding has
been going on for months, though its form has been variable.
Sometimes the squeak profiler shows it's using very little CPU, while
the operating system tools disagree.  Sometimes garbage collecting or
saving the image helps.  At the moment, they don't.  Completely
exiting the image and restarting grants a temporary respite.

Undoubtedly I need to redesign my app, but I'd like to survive until I
get that done.  My current plan:
1. migrate to 3.8 image
2. add database
3. see what problems remain and redesign as needed.

I think for most db's (I'm going to try Magma) require a current
image, so 1 needs to come first.  Also, DateAndTime is a major time
sink, and 3.8 has a much zippier version.

I'm running the latest official Unix VM on Debian; I think that's
basically the same as Ian's latest release.  My image is roughly
3.6. Some stats:

Smalltalk vmVersion 'Squeak3.8gamma of ''24 November 2004'' [latest
update: #6548]'

memory			104,027,704 bytes
	old			46,287,164 bytes (44.5%)
	young		335,604 bytes (0.3%)
	used		46,622,768 bytes (44.8%)
	free		57,404,936 bytes (55.2%)
GCs				6,982 (131ms between GCs)
	full			0 totalling 0ms (0.0% uptime)
	incr		6982 totalling 28,468ms (3.0% uptime), avg 4.0ms
	tenures		19 (avg 367 GCs/tenure)
Since last view	-397,640
	uptime		-116345.1s
	full			-34 totalling -15,907ms (0.0% uptime), avg 468.0ms
	incr		-397606 totalling -346,430ms (0.0% uptime), avg 
	tenures		-167 (avg 2380 GCs/tenure)

WeakKeyAssociation allInstances size 7456 (though this last statistic
is while the system was behaving OK after a quit and restart).

Ross Boylan



More information about the Squeak-dev mailing list