haskell / vector

An efficient implementation of Int-indexed arrays (both mutable and immutable), with a powerful loop optimisation framework .
Other
367 stars 139 forks source link

Vector tests take more than 4GB memory to build #449

Closed harendra-kumar closed 10 months ago

harendra-kumar commented 2 years ago

Whenever I have to build a nix derivation for some Haskell package which depends on vector it fails to build on a 4GB machine because of vector tests. This should be fixed as vector is an important package on which a large set of libraries/packages depend.

We can add a -M2G to the tests and break the test modules that take too much memory into multiple modules.

lehins commented 2 years ago

I am definitely all for reducing memory and time during build or runtime for that matter. However, if you don't mind me asking, where is this limitation of 4Gb comes from and why should we adhere to it? 32bit machines aren't that common anymore and even CI VMs nowadays have at least 8Gb of RAM.

Regardless of the motivation, I personally would not oppose someone submitting a PR with the fix suggested in the issue: "add a -M2G to the tests and break the test modules that take too much memory into multiple modules."

Linking some relevant tickets:

harendra-kumar commented 2 years ago

where is this limitation of 4Gb comes from and why should we adhere to it?

It is an arbitrary number, there is no particular reason for that, just that I usually develop on an AWS machine with 4GB RAM and usually I never have any memory issues that force me to use a bigger machine. I thought 4GB should be enough RAM for normal build purposes. I try to make my libraries build in less than 1GB or even 512 MB.

Shimuuar commented 10 months ago

I'm closing as duplicate of #274. Unboxed are real culprit of excessive memory consumption.