m2_memory
Monitor the Macaulay2 kernel's memory (RSS, peak, swap, uptime) without affecting the session. Call it during long computations to decide if interruption is worthwhile.
Instructions
Report the persistent Macaulay2 kernel's memory: RSS, peak, swap, pid, uptime.
Reads the operating system's bookkeeping for the kernel child process — an unprivileged read; nothing is sent to M2 and the session is untouched. Peak comes from kernel-tracked counters (no sampler involved); swap is M2's own swapped pages on Linux, or the system-wide swap growth since this kernel started on macOS (no unprivileged per-process counter exists there). The probe is lock-free: call it WHILE a long m2_evaluate runs to watch memory live before deciding whether m2_interrupt is worthwhile. RSS reads as a high-water mark because M2 rarely returns freed pages to the OS.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |