# 内存模式

xlswriter 提供两种写入内存策略：

* **常规模式** —— 整个工作簿数据保留在内存中，速度最快，但内存占用与数据量成正比。
* [**固定内存模式**](/zhong-wen-jian-ti/memory/fixed-memory.md) —— 数据按行落盘，内存中只保留最新一行；无论文件大小，峰值内存通常 <1 MB。导出百万级行数据时强烈推荐。

当数据量可能超出 `memory_limit` 时，应优先选择固定内存模式。


---

# 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://xlswriter-docs.viest.me/zhong-wen-jian-ti/memory.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.
