# 内存隔离

memcg在当前云计算场景下被广泛应用，其目标是限定用户对主机内存的使用。本章我们将对memcg的工作原理做探究。

首先我们来简单看一下[memcg初始化](/kernel-exploring/nei-cun-guan-li/00-index-2/01-init_overview.md)的过程。因为memcg是cgroup的子系统，所以更多的细节可以看[cgroup](/kernel-exploring/00-index.md)。

既然memcg是用来限制用户对内存使用的，那么自然我们要了解如何[限制memcg大小](/kernel-exploring/nei-cun-guan-li/00-index-2/02-set_memcg_limit.md)和[对memcg记账](/kernel-exploring/nei-cun-guan-li/00-index-2/03-charge_memcg.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://richardweiyang-2.gitbook.io/kernel-exploring/nei-cun-guan-li/00-index-2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
