On 20.10.2011 15:30, Igor Stasenko wrote:
2011/10/20 Janko Mivšek<[email protected]>:
Hi guys,
I'm measuring how my image is breathing through the time and what is
interesting is how nr. of Semaphore instances is variating through the
time. Every hour just before snapshot I report nr of instances, see last
10 hours:
** image state:
0 HTTPCommections
4 Sockets
22 Processes
259 Semaphores
** image state:
0 HTTPCommections
4 Sockets
22 Processes
274 Semaphores
** image state:
0 HTTPCommections
4 Sockets
22 Processes
312 Semaphores
** image state:
0 HTTPCommections
4 Sockets
22 Processes
356 Semaphores
** image state:
0 HTTPCommections
4 Sockets
22 Processes
346 Semaphores
** image state:
0 HTTPCommections
4 Sockets
22 Processes
141 Semaphores
** image state:
0 HTTPCommections
4 Sockets
22 Processes
310 Semaphores
** image state:
0 HTTPCommections
4 Sockets
26 Processes
79 Semaphores
** image state:
0 HTTPCommections
4 Sockets
20 Processes
300 Semaphores
Well, the number of semaphores tells nothing because not all of them
serve for sockets.
There are 3 semaphores per socket. So, if you have 4 sockets, there
should be 12 external objects.
Of course not counting others, which is there for other purposes.
Could you add following to report:
Socket registry size
StandardFileStream registry size
(ExternalSemaphoreTable unprotectedExternalObjects reject: #isNil) size
There's something wrong with startup/shutdown list, at least with my
Pharo 1.4 image...
The InputEventFetcher's shutdown/startup methods are called twice when
you save, thus you end up with an extra semaphore in the table whenever
you save.
Janko just runs into the consequences of this faster as he saves frequently.
Cheers,
Henry
View transcript when saving with InputEventFetcher doing logging like:
shutDown
self crLog: 'Shutdown called!'.
self terminateEventLoop.
inputSemaphore ifNotNil: [|pre post|
pre := (ExternalSemaphoreTable unprotectedExternalObjects
select: [:each | each notNil]) size.
Smalltalk unregisterExternalObject: inputSemaphore.
post := (ExternalSemaphoreTable unprotectedExternalObjects
select: [:each | each notNil]) size.
pre = post ifTrue: [self logCr: 'Tried unregistering
inputSemaphore, but still there!']]
startUp
self crLog: 'Startup called!'.
inputSemaphore := Semaphore new.
self primSetInputSemaphore: (Smalltalk registerExternalObject:
inputSemaphore).
inputSemaphore initSignals.
self installEventLoop