> For the complete documentation index, see [llms.txt](https://sliu583.gitbook.io/blog/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sliu583.gitbook.io/blog/specific-work/wisr-group/group/semeru-a-memory-disaggregated-managed-runtime.md).

# Semeru: A memory-disaggregated managed runtime

### Motivation&#x20;

![](/files/-MWdai4VKvv74igZ-txD)

* All resources sitting in different resource pools&#x20;
  * CPU servers: small memory
  * Memory servers: not high processing powers, handling memory accesses&#x20;
    * Today usage?&#x20;
  * Storage servers: weak core
* &#x20;Network: InfiniBand, high bandwidth&#x20;

![](/files/-MWdbaLbzXyAuDnLkGQw)

* Resource is not fully utilized&#x20;
  * This can help all the workloads to share resource better
  * Multiplex different people's workload&#x20;
* Moving towards&#x20;
  * But most cloud services are still pre-configured&#x20;

![](/files/-MWdcjXNETwKhQ4xvqSO)

* Don't understand the actual workload&#x20;
* Managed languages:
  * Program relies on language runtime (sit between user runtime and OS) to manage memory&#x20;
  * Java (objects), how these are allocated (memory), the allocated memory is not contiguous (?) digging into JVM&#x20;

![](/files/-MWddWVE8mzD6okpW0K4)

* Write something in C, manage memory allocation&#x20;
  * JVM takes care of tracing in the memory

![](/files/-MWddnJ6ZjZWAOizCfLL)

* Takes over CPU and bandwidth&#x20;

![](/files/-MWde2ee8Ijf1QYj6Uxi)

* Remote memory, two Spark applications (graph like applications)&#x20;
* Cache Ratio
  * 50%/75% goes remote&#x20;
  * No swap: best case (baseline), all accesses go locally&#x20;

![](/files/-MWdfMdb5IkA-32z4Sdp)

* GC work
  * Not much compute (suitable for memory server compute power)&#x20;
  * Data loaded locally to the memory server, cheaper&#x20;
  * Run concurrently with the program itself (not compete for resources)&#x20;

![](/files/-MWdfw5-TCZ-0VTNHH48)

![](/files/-MWdfzuDqwsQrNMY1rt3)

![](/files/-MWdgC42iwVVPBKQ4GdU)

![](/files/-MWdgFkoB1gCjk_TmRKD)

* Accessing the dirty page again?&#x20;

![](/files/-MWdgct4ax0bT-7ZAE6j)

![](/files/-MWdglOeWKLNcWSb-LMF)

* Java&#x20;
  * GC: find all objects that will never be used again&#x20;
    * E.x. variable within the loop, can be cleaned after this loop&#x20;
* Tracing is not computationally heavy&#x20;
  * Cheaper to store all tracing on local memory in memory server&#x20;

![](/files/-MWdhvmCJ-MhlNwfc3YP)

![](/files/-MWdiDL7poirQchhypqh)

![](/files/-MWdiHhp57s413euLhNB)

* Several rounds of GC:&#x20;
  * If these objects are still there, likely to remain for longer period of time
  * Java does less cleaning to older objects, and spend more times on newly-created objects&#x20;

![](/files/-MWdirfLqKVbeLjvAOO9)

![](/files/-MWdj2MsdJZKpuKFqciQ)

* Memory servers: recycling the regions of themselves&#x20;
* Data layout: reduce memory segmentation&#x20;

#### #3: how to efficiently swap data

![](/files/-MWdjPRqhjr-sO0ujZZ6)

* Control path onto different memory servers&#x20;
* Data Path
* Not interfere with each other&#x20;
* Paging:
  * Managed by the OS
  * Runtime access the page?&#x20;
    * Bypass the OS?
    * JVM has the mapping between the two&#x20;
  * Map the virtual pages in runtime to physical allocation on the memory servers&#x20;
* LegoOS:
  * this kind of disaggregated architecture&#x20;
  * Not support JVM&#x20;
  * Existing OS, then for OS, not be able to distinguish (which to handle locally, which to handle on remote). Implement this, having more flexibility.&#x20;
* Language runtime knows the program much better instead of OS&#x20;

![](/files/-MWdjb_zcV_tEw-wZ5Eb)

![](/files/-MWdnUPMqG2e0bK2grBZ)

![](/files/-MWdnsm_SnBaaw8y4F9S)

![](/files/-MWdo9titZBvLeZd5Bz0)

* JVM on disaggregated&#x20;
* GC implemented inside of JVM rather than doing this directly from the OS&#x20;
