[squeak-dev] lowSpaceWatcher problems

Eliot Miranda eliot.miranda at gmail.com
Wed Mar 20 22:51:11 UTC 2013


On Wed, Mar 20, 2013 at 1:34 PM, Chris Muller <asqueaker at gmail.com> wrote:

> It can be used by external apps but at this time one would be
> ill-advised to depend on it.  As my prior note shows, the cog VM does
> not signal the LowSpaceSemaphore until it is so maxed out on memory
> that the initial GC prior to calling #freeSomeSpace crashes the VM.
> There is no chance for any registered memory-hog to act on the
> low-memory condition.
>

Which is a bad bug.  And to be pedantic is actually false.  The Cog VM
*does* signal low space, at least sometimes :)  For example the following
just triggered low space at depth 476 in a trunk image on Mac OS X.

| b |
Smalltalk garbageCollect.
b := #assigned.
b := [:d :r|
 (d \\ 10) = 0 ifTrue:
[Display reverse: (0 at 0 corner: d at d/10)].
 d >= 800 ifTrue:
[[Project current interruptName: 'User Interrupt @ ', d printString]
newProcess
priority: Processor activePriority + 1;
resume].
 b value: d + 1 value: (Array new: 1024 * 1024 / 4)].
b value: 0 value: nil

The UserInterrupt thang is to try and reproduce a crash I had when I
interrupted the simpler case below which then crashed the VM:

| b |
Smalltalk garbageCollect.
b := #assigned.
b := [:d :r|
 b value: d + 1 value: (Array new: 1024 * 1024 / 4)].
b value: 0 value: nil



> In my initial note I tried to ask whether the #lowSpaceThreshold could
> simply be increased to fix that but did not get a clear answer.
>

I don't know yet.  I have a crash to investigate on Windows that points to
the problem being the amount of space Cog reserves for flushing stack pages
to the heap as contexts.  Reproducible cases that do crash and don't take
an age to run much appreciated :-/.

On Tue, Mar 19, 2013 at 12:21 PM, karl ramberg <karlramberg at gmail.com>
> wrote:
> > :-)
> >
> >
> >
> > On Tue, Mar 19, 2013 at 3:07 PM, Frank Shearar <frank.shearar at gmail.com>
> > wrote:
> >>
> >> More accurately: the base image doesn't have any memory hogs :)
> >>
> >> frank
> >>
> >> On 19 March 2013 11:21, karl ramberg <karlramberg at gmail.com> wrote:
> >> > Ok, I see.
> >> > So it's a feature not used in the 4.4 release image.
> >> >
> >> > Karl
> >> >
> >> >
> >> >
> >> > On Tue, Mar 19, 2013 at 9:12 AM, Georg Gollmann
> >> > <gollmann at zid.tuwien.ac.at>
> >> > wrote:
> >> >>
> >> >>
> >> >> Am 18.03.2013 um 23:29 schrieb karl ramberg <karlramberg at gmail.com>:
> >> >>
> >> >> I don't see how #memoryHogs and #freeSomeSpace can work.
> >> >> ...
> >> >> #freeSomeSpace is not implemented and
> SystemDictionary>>lowSpaceWatcher
> >> >> is
> >> >> the only sender of #memoryHogs
> >> >>
> >> >>
> >> >> Memory hogs are supposed to implement #freeSomeSpace and register
> >> >> themselves with the lowSpaceWatcher.
> >> >>
> >> >> Kind regards
> >> >> Georg
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >
> >> >
> >> >
> >> >
> >>
> >
> >
> >
> >
>
>


-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130320/36eb3eb9/attachment.htm


More information about the Squeak-dev mailing list