Skip to content

Drop UV_STACK_SIZE in favour of RUST_MIN_STACK #10367

@Gankra

Description

@Gankra

RUST_MIN_STACK is fairly obscure and barely documented but it does exist specifically to do exactly what UV_STACK_SIZE does (it would affect all non-main threads and not just tokio threads, but the fact that we only resize tokio threads is not really intentional so much as Convenient).

Alternatively: it's really unclear why we need to set the stack size specifically on Windows. All information I can find suggests Rust already forces Windows, macOS, and Linux to all use 2MiB stacks for non-main-threads by default (and UV_STACK_SIZE doesn't affect the main thread).

Unfortunately there's a ton of possibilities:

  • Newer versions of Rust fixed this and we don't actually need it anymore?
  • Windows wastes more of your stack space with OS-internal datastructures (like the TEB)?
  • Some platform-specific types are weirdly bigger on Windows?
  • Windows' ABI/codegen forces more stackspills bloating the stack way more?

Metadata

Metadata

Assignees

No one assigned

    Labels

    internalA refactor or improvement that is not user-facing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions