Skip to content

Building std_spec runs ouf memory on 32-bit platform #11073

Open
@straight-shoota

Description

@straight-shoota

The test_linux32 job is continuously failing because the compiler runs out of memory while building std_spec (example: https://github.com/crystal-lang/crystal/runs/3260787966).

It seems that the amount of specs for the standard library is exceeding the limitations of 32-bit address space (or available memory on the runner machine, but I suppose both are probably 4 GB). That's kind of a good sign because it means we have a lot of test cases. (On the other hand, the compiler is also very memory hungry 😢)

There had previously been issues while running the stdlib specs which have been worked around by splitting spec execution into several batches (#8065).
We should be able to apply a similar workaround when building the standard specs. We could split the top-level entries in spec/std/ into different buckets to build and run them separately.

As an alternative, we could also try to increase swap space on the CI runner. But I expect splitting stdlib specs would be more efficient. It's also generally useful for any system with memory limitations (I recently tried to compile stdlib specs on a Raspberry PI with 2GB memory 🙈).
If we could make sure there are no interferences or side effects, this could also be an efficient way to parallelize specs. Perhaps it could work with a separate cache directory for every batch. Might be an idea to investigate as a follow-up...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions