[squeak-dev] Low-space considerations ... :-)

Marcel Taeumel marcel.taeumel at hpi.de
Tue Jul 12 06:15:25 UTC 2022


Aha. Via #handleFailingFailingBasicNew:, OutOfMemory >> #defaultAction signals the LowSpaceSemaphore. And at that point, special object 23 was not yet set. Hmm....

Best,
Marcel
Am 12.07.2022 08:13:15 schrieb Marcel Taeumel <marcel.taeumel at hpi.de>:
Hi Eliot --

> Our #lowSpaceWatcher seems to be broken because "Smalltalk specialObjectsArray at: 23" is always "nil".
>> [...] The vm sets it to the active process when it signals the low space semaphore.

And that's not working at the moment. Even after the LowSpaceSemaphore got signaled:

Smalltalk vmParameterAt: 67 put: 1 * 1024 * 1024 * 1024.
Array new: (0.125 * 1 * 1024 * 1024 * 1024) rounded.

One has to push CMD+Dot to then see that the #lowSpaceWatcher complains that  it cannot retrieve the preemptedProcess via special object 23.

> Has #primSignalAtBytesLeft: (primitive 125) any effect these days?
>> Yes.

Hmm... I can only find places that set it to 0. :-) ... Wait ... Ah! Nevermind. xD

>> So infinite recursion (as it always did) causes heap growth, and the issue of sluggishness did to paging comes to the fore.

Ah! That was my hypothesis. Yet, since the #lowSpaceWatcher seems to be broken, I wondered what was going on.

Thanks! :-)

Best,
Marcel


Am 12.07.2022 08:02:28 schrieb Eliot Miranda <eliot.miranda at gmail.com>:
Hi Marcel,

On Jul 11, 2022, at 6:15 AM, Marcel Taeumel <marcel.taeumel at hpi.de> wrote:



Hi all --

What's the current state of our low-space guards in Squeak? That OutOfMemory error only works with larger allocations, right?

Our #lowSpaceWatcher seems to be broken because "Smalltalk specialObjectsArray at: 23" is always "nil". Should we replace it with "Processor preemptedProcecss"?

No, it *should* be nil.  The vm sets it to the active process when it signals the low space semaphore.  Hence "Smalltalk specialObjectsArray at: 23" reliably informs the image level low space code which process performed the allocation that tripped the low space trigger.

Has #lowSpaceThreshold any effect these days?

Yes.  But given that Spur attempts to grow the heap dynamically and contemporary OSs are only too happy to comply, the low space trigger may only be seen to work if a limit on old space size has been installed.  Otherwise it’ll most likely not trigger before the system starts to page itself into sluggishness.


Has #primSignalAtBytesLeft: (primitive 125) any effect these days?

Yes.


Can there ever be an image-level protection against stack-page shortage? VM parameter 42 seems to be 50 (num stack pages), which lasts for quite some time in endless recursion ... but CMD+Dot stops working at some point because of some stack-growing issues? And then the VM crashes eventually.

Again that’s not how things work.  The stack zone is fixed size.  When a new stack page is needed the oldest page is evacuated to the heap in the form of Context objects.  So infinite recursion (as it always did) causes heap growth, and the issue of sluggishness did to paging comes to the fore.



Best,
Marcel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220712/8145c939/attachment.html>


More information about the Squeak-dev mailing list