Skip to content

Instantly share code, notes, and snippets.

@contrun
Last active January 23, 2025 13:01
Show Gist options
  • Save contrun/2320b13f8f7da3963b51152c41b253f5 to your computer and use it in GitHub Desktop.
Save contrun/2320b13f8f7da3963b51152c41b253f5 to your computer and use it in GitHub Desktop.

Ractor Memory Usage Benchmark

Benchmark executable: ractor/ractor/examples/bench_memory_usage.rs at a54249dd72e30f67b4b75f3c2cec535d68b8718d · contrun/ractor

Ractor version: roughly 0.14.7 slawlor/ractor at f9ccc48d16dcddb9ff87f55987e2089bfb9fbb47

Result Sumary

A ractor actor roughly consumes 10KiB of memory. So spawning 100K actors requiresapproximately 1G memory.

#Actors State Size #Messages Allocated Memory Usage Resident Memory Usage
100,000 1KiB 100 1,583,206,908B 1,690,423,569B
100,000 1KiB 0 968,952,850B 1,238,885,376B
100,000 0B 100 1,468,003,372B 1,575,197,549B
100,000 0B 0 853,720,966B 1,000,935,423B
10,000 1KiB 100 158,790,960B 372,472,320B
10,000 1KiB 0 97,500,886B 334,428,023B
10,000 0B 100 147,337,738B 229,525,796B
10,000 0B 0 85,955,519B 158,549,105B

Raw Data

Creation of 100000 actors with 100 messages and state size 1024 1583177648 bytes allocated/1631604736 bytes resident Creation of 100000 actors with 100 messages and state size 1024 1583199808 bytes allocated/1703452672 bytes resident Creation of 100000 actors with 100 messages and state size 1024 1583210432 bytes allocated/1702723584 bytes resident Creation of 100000 actors with 100 messages and state size 1024 1583242640 bytes allocated/1709154304 bytes resident Creation of 100000 actors with 100 messages and state size 1024 1583248224 bytes allocated/1704812544 bytes resident Creation of 100000 actors with 100 messages and state size 1024 1583199456 bytes allocated/1705492480 bytes resident Creation of 100000 actors with 100 messages and state size 1024 1583196384 bytes allocated/1703776256 bytes resident Creation of 100000 actors with 100 messages and state size 1024 1583222000 bytes allocated/1705238528 bytes resident Creation of 100000 actors with 100 messages and state size 1024 1583197040 bytes allocated/1705074688 bytes resident Creation of 100000 actors with 100 messages and state size 1024 1583179584 bytes allocated/1693741056 bytes resident Creation of 100000 actors with 100 messages and state size 1024 1583205136 bytes allocated/1703116800 bytes resident Creation of 100000 actors with 100 messages and state size 1024 1583194688 bytes allocated/1636106240 bytes resident Creation of 100000 actors with 100 messages and state size 1024 1583251216 bytes allocated/1709527040 bytes resident Creation of 100000 actors with 100 messages and state size 1024 1583190416 bytes allocated/1706430464 bytes resident Creation of 100000 actors with 100 messages and state size 1024 1583188960 bytes allocated/1636102144 bytes resident

Creation of 100000 actors with 0 messages and state size 1024 969110272 bytes allocated/1361145856 bytes resident Creation of 100000 actors with 0 messages and state size 1024 968762480 bytes allocated/1559965696 bytes resident Creation of 100000 actors with 0 messages and state size 1024 968949088 bytes allocated/1395228672 bytes resident Creation of 100000 actors with 0 messages and state size 1024 968985424 bytes allocated/1177399296 bytes resident Creation of 100000 actors with 0 messages and state size 1024 968824512 bytes allocated/1160421376 bytes resident Creation of 100000 actors with 0 messages and state size 1024 969009200 bytes allocated/1402388480 bytes resident Creation of 100000 actors with 0 messages and state size 1024 968954976 bytes allocated/1220108288 bytes resident Creation of 100000 actors with 0 messages and state size 1024 968987280 bytes allocated/1155141632 bytes resident Creation of 100000 actors with 0 messages and state size 1024 968825984 bytes allocated/1151107072 bytes resident Creation of 100000 actors with 0 messages and state size 1024 969018224 bytes allocated/1150910464 bytes resident Creation of 100000 actors with 0 messages and state size 1024 969053920 bytes allocated/1136672768 bytes resident

Creation of 100000 actors with 100 messages and state size 0 1468049072 bytes allocated/1516335104 bytes resident Creation of 100000 actors with 100 messages and state size 0 1468041936 bytes allocated/1585233920 bytes resident Creation of 100000 actors with 100 messages and state size 0 1468077600 bytes allocated/1592774656 bytes resident Creation of 100000 actors with 100 messages and state size 0 1467988976 bytes allocated/1561407488 bytes resident Creation of 100000 actors with 100 messages and state size 0 1468008800 bytes allocated/1520467968 bytes resident Creation of 100000 actors with 100 messages and state size 0 1468003008 bytes allocated/1587154944 bytes resident Creation of 100000 actors with 100 messages and state size 0 1468000368 bytes allocated/1589903360 bytes resident Creation of 100000 actors with 100 messages and state size 0 1468019360 bytes allocated/1587716096 bytes resident Creation of 100000 actors with 100 messages and state size 0 1467994528 bytes allocated/1571299328 bytes resident Creation of 100000 actors with 100 messages and state size 0 1467978000 bytes allocated/1588559872 bytes resident Creation of 100000 actors with 100 messages and state size 0 1467955888 bytes allocated/1586495488 bytes resident Creation of 100000 actors with 100 messages and state size 0 1467971968 bytes allocated/1589145600 bytes resident Creation of 100000 actors with 100 messages and state size 0 1467962880 bytes allocated/1590571008 bytes resident Creation of 100000 actors with 100 messages and state size 0 1467994832 bytes allocated/1585700864 bytes resident Creation of 100000 actors with 100 messages and state size 0

Creation of 100000 actors with 0 messages and state size 0 853774064 bytes allocated/883339264 bytes resident Creation of 100000 actors with 0 messages and state size 0 853682944 bytes allocated/1220251648 bytes resident Creation of 100000 actors with 0 messages and state size 0 853695536 bytes allocated/1199431680 bytes resident Creation of 100000 actors with 0 messages and state size 0 853762272 bytes allocated/1088675840 bytes resident Creation of 100000 actors with 0 messages and state size 0 853682640 bytes allocated/1021882368 bytes resident Creation of 100000 actors with 0 messages and state size 0 853579008 bytes allocated/1007276032 bytes resident Creation of 100000 actors with 0 messages and state size 0 853816496 bytes allocated/985088000 bytes resident Creation of 100000 actors with 0 messages and state size 0 853646880 bytes allocated/974336000 bytes resident Creation of 100000 actors with 0 messages and state size 0 853560656 bytes allocated/970387456 bytes resident Creation of 100000 actors with 0 messages and state size 0 853694656 bytes allocated/962404352 bytes resident Creation of 100000 actors with 0 messages and state size 0 853704240 bytes allocated/953630720 bytes resident Creation of 100000 actors with 0 messages and state size 0 853769888 bytes allocated/961503232 bytes resident Creation of 100000 actors with 0 messages and state size 0 853686288 bytes allocated/938864640 bytes resident Creation of 100000 actors with 0 messages and state size 0 853693888 bytes allocated/955346944 bytes resident Creation of 100000 actors with 0 messages and state size 0 853827184 bytes allocated/960397312 bytes resident Creation of 100000 actors with 0 messages and state size 0 853804896 bytes allocated/965967872 bytes resident Creation of 100000 actors with 0 messages and state size 0 853874896 bytes allocated/967118848 bytes resident Creation of 100000 actors with 0 messages and state size 0

Creation of 10000 actors with 100 messages and state size 1024 158760208 bytes allocated/172478464 bytes resident Creation of 10000 actors with 100 messages and state size 1024 158763424 bytes allocated/261185536 bytes resident Creation of 10000 actors with 100 messages and state size 1024 158777680 bytes allocated/291782656 bytes resident Creation of 10000 actors with 100 messages and state size 1024 158827520 bytes allocated/339083264 bytes resident Creation of 10000 actors with 100 messages and state size 1024 158780432 bytes allocated/364711936 bytes resident Creation of 10000 actors with 100 messages and state size 1024 158771424 bytes allocated/389709824 bytes resident Creation of 10000 actors with 100 messages and state size 1024 158802704 bytes allocated/410701824 bytes resident Creation of 10000 actors with 100 messages and state size 1024 158776192 bytes allocated/405467136 bytes resident Creation of 10000 actors with 100 messages and state size 1024 158811280 bytes allocated/411377664 bytes resident Creation of 10000 actors with 100 messages and state size 1024 158795296 bytes allocated/432209920 bytes resident Creation of 10000 actors with 100 messages and state size 1024 158795152 bytes allocated/433143808 bytes resident Creation of 10000 actors with 100 messages and state size 1024 158800992 bytes allocated/408883200 bytes resident Creation of 10000 actors with 100 messages and state size 1024 158782352 bytes allocated/433233920 bytes resident Creation of 10000 actors with 100 messages and state size 1024 158823136 bytes allocated/418611200 bytes resident Creation of 10000 actors with 100 messages and state size 1024 158782768 bytes allocated/397615104 bytes resident Creation of 10000 actors with 100 messages and state size 1024 158804800 bytes allocated/389361664 bytes resident Creation of 10000 actors with 100 messages and state size 1024

Creation of 10000 actors with 0 messages and state size 1024 97590880 bytes allocated/347807744 bytes resident Creation of 10000 actors with 0 messages and state size 1024 97471760 bytes allocated/322830336 bytes resident Creation of 10000 actors with 0 messages and state size 1024 97540928 bytes allocated/341884928 bytes resident Creation of 10000 actors with 0 messages and state size 1024 97582000 bytes allocated/318779392 bytes resident Creation of 10000 actors with 0 messages and state size 1024 97535776 bytes allocated/314298368 bytes resident Creation of 10000 actors with 0 messages and state size 1024 97485520 bytes allocated/319586304 bytes resident Creation of 10000 actors with 0 messages and state size 1024 97520000 bytes allocated/328347648 bytes resident Creation of 10000 actors with 0 messages and state size 1024 97587504 bytes allocated/346238976 bytes resident Creation of 10000 actors with 0 messages and state size 1024 97534048 bytes allocated/338767872 bytes resident Creation of 10000 actors with 0 messages and state size 1024 97609680 bytes allocated/320638976 bytes resident Creation of 10000 actors with 0 messages and state size 1024 97575488 bytes allocated/323182592 bytes resident Creation of 10000 actors with 0 messages and state size 1024 97359408 bytes allocated/353947648 bytes resident Creation of 10000 actors with 0 messages and state size 1024 97417888 bytes allocated/363933696 bytes resident Creation of 10000 actors with 0 messages and state size 1024 97406800 bytes allocated/343117824 bytes resident Creation of 10000 actors with 0 messages and state size 1024 97295616 bytes allocated/333058048 bytes resident

Creation of 10000 actors with 100 messages and state size 0 147230768 bytes allocated/158871552 bytes resident Creation of 10000 actors with 100 messages and state size 0 147323232 bytes allocated/225120256 bytes resident Creation of 10000 actors with 100 messages and state size 0 147308464 bytes allocated/228634624 bytes resident Creation of 10000 actors with 100 messages and state size 0 147371616 bytes allocated/228855808 bytes resident Creation of 10000 actors with 100 messages and state size 0 147320880 bytes allocated/220966912 bytes resident Creation of 10000 actors with 100 messages and state size 0 147290560 bytes allocated/224829440 bytes resident Creation of 10000 actors with 100 messages and state size 0 147407120 bytes allocated/246415360 bytes resident Creation of 10000 actors with 100 messages and state size 0 147282336 bytes allocated/237355008 bytes resident Creation of 10000 actors with 100 messages and state size 0 147612016 bytes allocated/239558656 bytes resident Creation of 10000 actors with 100 messages and state size 0 147279424 bytes allocated/240242688 bytes resident Creation of 10000 actors with 100 messages and state size 0 147354928 bytes allocated/232181760 bytes resident Creation of 10000 actors with 100 messages and state size 0 147314880 bytes allocated/243601408 bytes resident Creation of 10000 actors with 100 messages and state size 0 147345648 bytes allocated/245424128 bytes resident Creation of 10000 actors with 100 messages and state size 0 147286464 bytes allocated/241303552 bytes resident Creation of 10000 actors with 100 messages and state size 0

Creation of 10000 actors with 0 messages and state size 0 86046960 bytes allocated/96030720 bytes resident Creation of 10000 actors with 0 messages and state size 0 86016832 bytes allocated/144195584 bytes resident Creation of 10000 actors with 0 messages and state size 0 85848048 bytes allocated/150253568 bytes resident Creation of 10000 actors with 0 messages and state size 0 85970464 bytes allocated/152580096 bytes resident Creation of 10000 actors with 0 messages and state size 0 86007184 bytes allocated/147013632 bytes resident Creation of 10000 actors with 0 messages and state size 0 86030080 bytes allocated/150003712 bytes resident Creation of 10000 actors with 0 messages and state size 0 85911664 bytes allocated/151437312 bytes resident Creation of 10000 actors with 0 messages and state size 0 85862304 bytes allocated/152510464 bytes resident Creation of 10000 actors with 0 messages and state size 0 86010768 bytes allocated/156880896 bytes resident Creation of 10000 actors with 0 messages and state size 0 85852992 bytes allocated/161792000 bytes resident Creation of 10000 actors with 0 messages and state size 0 85803504 bytes allocated/169136128 bytes resident Creation of 10000 actors with 0 messages and state size 0 85895072 bytes allocated/164737024 bytes resident Creation of 10000 actors with 0 messages and state size 0 86021456 bytes allocated/172613632 bytes resident Creation of 10000 actors with 0 messages and state size 0 85965888 bytes allocated/175353856 bytes resident Creation of 10000 actors with 0 messages and state size 0 86042864 bytes allocated/176513024 bytes resident Creation of 10000 actors with 0 messages and state size 0 86024480 bytes allocated/180523008 bytes resident Creation of 10000 actors with 0 messages and state size 0 85851984 bytes allocated/172883968 bytes resident Creation of 10000 actors with 0 messages and state size 0 86036800 bytes allocated/179425280 bytes resident Creation of 10000 actors with 0 messages and state size 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment