<p>The current default eden size for 64-bits is 8 Mb which is too small.  The performance cost of generation scavenging on 64-bits is radically different at 8Mb vs e.g. 64Mb.  For example, here are the GC stats and the time to run for recompiling the Morphic package in a trunk Squeak 640-bit image, collected by running</p>
<p>FileStream stdout print: [(PackageInfo named: 'Morphic') methods do:<br>
[:mr| mr actualClass recompile: mr selector]] timeToRun; cr.<br>
FileStream stdout nextPutAll:<br>
(Smalltalk vm vmStatisticsReportString<br>
replaceAll: Character cr with: Character linefeed)</p>
<p>squeak> 7061<br>
uptime          0m 7s<br>
memory          85,073,920 bytes<br>
old                     76,121,888 bytes (89.5%)<br>
young           7,190,528 bytes (8.5%)<br>
used            54,408,216 bytes (64%)<br>
free            26,774,568 bytes (31.5%)<br>
GCs                     195 (38.2 ms between GCs)<br>
full            0 totalling 0 ms (0% runtime), avg 0 ms<br>
scavenges       195 totalling 82 ms (1.1% runtime), avg 0.4 ms<br>
tenures         21,139 (avg 108 tenures per scavenge)<br>
Code compactions<br>
0</p>
<p>Aeolus.image$ spur64cfvm -eden 60m spurreader-64. <RecompileMorphicAndReport.st<br>
squeak> 6968<br>
uptime          0m 7s<br>
memory          140,648,448 bytes<br>
old                     76,121,888 bytes (54.1%)<br>
young           61,896,704 bytes (44%)<br>
used            62,854,824 bytes (44.7%)<br>
free            43,764,376 bytes (31.1%)<br>
GCs                     23 (318.5 ms between GCs)<br>
full            0 totalling 0 ms (0% runtime), avg 0 ms<br>
scavenges       23 totalling 30 ms (0.41% runtime), avg 1.3 ms<br>
tenures         0<br>
Code compactions<br>
0</p>
<p>While the run-time varies very little (7 seconds to 6.97 seconds), the number of scavenges goes down enormously.  The reason the run-time is relatively unaffected is because the generation scavenger is quite efficient.  At an 8mb young space we see 195 scavenges with about a 1.1% runtime overhead.  But at a 64mb young space we see 23 scavenges (a ratio of about 8, which mirrors the ratio of the sizes), but the run-time overhead is now only 0.41%; 82ms overhead vs 30ms overhead.  So a larger young space is a good idea.</p>
<p>The suggestion here is that on 64-bit platforms we tailor the default young space size to the available memory.  See e.g. <a href="https://stackoverflow.com/questions/2513505/how-to-get-available-memory-c-g" rel="nofollow">https://stackoverflow.com/questions/2513505/how-to-get-available-memory-c-g</a> which provides code above sysconf on Unix and GlobalMemoryStatusEx on WIN32 for obtaining the total amount of physical memory available.  Therefore we could use a larger young space on systems with a lot more memory; for example 2Mb of young space per Gb of physical memory would give a 64-mb young space on 32Gb machines such as my fully loaded 2018 MacBook Pro Core i9.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/316">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AhLyW-Rc6TlvYaslW7W5Imjhr9UU347_ks5u1a2sgaJpZM4Y_loZ">mute the thread</a>.<img src="https://github.com/notifications/beacon/AhLyW_CwQjw6F8IexBjOm3AaoOIfPTFSks5u1a2sgaJpZM4Y_loZ.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"A better default eden size for 64-bits (#316)"}],"action":{"name":"View Issue","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/316"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/316",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/316",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "A better default eden size for 64-bits (#316)",
"sections": [
{
"text": "",
"activityTitle": "**Eliot Miranda**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@eliotmiranda",
"facts": [
{
"name": "Repository: ",
"value": "OpenSmalltalk/opensmalltalk-vm"
},
{
"name": "Issue #: ",
"value": 316
}
]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"OpenSmalltalk/opensmalltalk-vm\",\n\"issueId\": 316,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"OpenSmalltalk/opensmalltalk-vm\",\n\"issueId\": 316\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/316"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 419322393\n}"
}
],
"themeColor": "26292E"
}
]</script>