Skip to content

TestPropertiesOfConversion causes system freeze on Linux due to OOM with large integers #895

@andy-lee-cat

Description

@andy-lee-cat

Hi, thanks for the great tutorial!

I encountered a severe system freeze (requiring a hard reboot) when running TestPropertiesOfConversion on a Linux server (Aliyun ECS, 4 vCPU, 16GB RAM).

Reason: The testing/quick package generates random int values up to MaxInt64. The naive implementation of ConvertToRoman tries to process these massive numbers (e.g., constructing a string with quadrillions of "M"s), leading to rapid memory exhaustion and swap thrashing.

While macOS/Windows handle memory pressure with UI responsiveness, Linux kernels often become unresponsive due to heavy I/O blocking before OOM killer triggers.

Suggestion: I suggest adding a warning note before the code block to alert Linux users. I am happy to submit a PR to add a warning note.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions