<font face="arial" size="2"><p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;">I do get an early crash when I try your code on ourself.io</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;">Admittedly I am running the linux VM under the FreeBSD emulation layer, so it is quite possibly related to that.</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;">Hmm, now I notice:</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word; padding-left: 30px;">[Wed Apr 06 01:51:26 2022] info -- Scheduler started (according to snapshotAction schedulerInitial)<br />owner@russell/terminalMorph 1> memory testHeapExpansion<br />Self VM warning: some memory reserved by the VM has been used;<br />invoking emergency heap expansion...<br />Segmentation fault (core dumped)</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;">That's not right! But it may not be the same issue you are seeing...</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;">I haven't noticed much instability on a general basis but then I'm not doing anything which would use much memory.</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;">(BTW if anyone has the time and inclination, I'd be very supportive of a proper FreeBSD port. There are also some smaller projects I could suggest for people who want to get started on the VM, for example making Self work with unix domain sockets...)</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;">Russell</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;">-----Original Message-----<br />From: "Jecel Assumpcao Jr" <jecel@merlintec.com><br />Sent: Tuesday, April 5, 2022 8:59pm<br />To: "Self-interest" <self-interest@lists.selflanguage.org><br />Subject: [Self-interest] memory systems in Linux and Mac virtual machines<br /><br /></p>
<div id="SafeStyles1649207644">
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt; word-wrap: break-word;">A while back I wanted to show off the Self spy to illustrate a point to<br />a friend. To stress the memory system so it would be clear how it worked<br />I started by creating a small vector:<br /><br /> vector copySize: 1000<br /><br />and then filled it in with a bunch of other vectors:<br /><br /> 0 to: size-1 Do: [| :i | at: i Put: (vector copySize: 10)]<br /><br />then at each step I doubled the size of the leaf vectors:<br /><br /> 0 to: size-1 Do: [| :i | at: i Put:<br /> (vector copySize: 2*(at:i) size)]<br /><br />Just to keep track where we were, after each step I would evaluate<br /><br /> (at: 0) size<br /><br />As expected, the system was forced to create a new segment by the time I<br />got to 2560. It crashed on the next step, though sometimes I got one<br />more step before it crashed. At this point the heap is only a few<br />megabytes in size, so this shouldn't be a problem.<br /><br />This was a 2017 Linux virtual machine. Today I had the idea to try the<br />exact same thing on a 2017 Macintosh virtual machine. With it I was able<br />to get all the way up to 81920 and it didn't crash like in Linux but the<br />infamous colored beachball has been spinning for a couple of hours now.<br /><br />Not counting object headers, this step is trying to grow the heap from<br />about 320MB to around twice that. The spy showed exactly what I wanted<br />to illustrate with the old space having grown to around 90 segments.<br /><br />I had expected the behavior of both VMs to be the same, but it seems<br />that the Linux version it less stable. Does anyone else have a similar<br />experience?<br /><br />-- Jecel<br />_______________________________________________<br />Self-interest mailing list<br />Self-interest@lists.selflanguage.org<br />http://lists.selflanguage.org/mailman/listinfo/self-interest</p>
</div></font>