Files
scriptc/tests
Chris Tate 6d07a49cbf Return freed memory sooner: chunked shared writes, a bounded string spare, idle trims
Three runtime changes that lower peak memory without changing behavior:

- In programs with workers, process.stdout.write and process.stderr.write
  of a view into a SharedArrayBuffer read it through a 64 KiB buffer
  instead of copying the whole view first, so writing a 32 MB shared view
  no longer holds a second 32 MB. Programs without workers keep the direct
  write.
- The one-slot string spare keeps freed blocks of 512 bytes to 1 MiB only.
  A larger block stayed resident until a string of about its size came
  along, which a program that replaces its input with an edited copy never
  does.
- The main thread trims its arena when its event loop waits with nothing
  ready, once it has carved 16 MB more since its last trim, as a parking
  thread does: pages that hold only free blocks go back to the system while
  the program waits on its workers.
2026-10-28 23:24:06 -05:00
..
…