pin_memory
Lock a memory chunk to a project to prevent automatic eviction. Choose 'hard' for permanent retention or 'soft' for retention under memory pressure.
Instructions
将指定 chunk 锁定到当前项目,阻止被自动淘汰。
OS 类比:mlock(addr, len) — 将页面锁定在进程地址空间,阻止 swap out。
pin_type:
'hard' — 所有淘汰路径跳过该 chunk(stale reclaim、DAMON DEAD、kswapd ZONE_MIN)
适用:设计约束、不可变决策、关键架构知识
'soft' — 保护 stale reclaim 和 DAMON DEAD,但 kswapd 内存极度紧张时仍可淘汰
适用:重要但非关键的量化证据、近期决策
Args:
chunk_id: 要锁定的 chunk ID(可从 memory_lookup 结果中获取)
pin_type: 'hard' 或 'soft'(默认 'soft')
project: 项目 ID(默认自动解析当前目录)
Returns:
操作结果描述
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"chunk_id": "<chunk_id>"
},
"name": "pin_memory"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chunk_id | Yes | ||
| pin_type | No | soft | |
| project | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |