Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very high memory usage #820

Open
tysonzero opened this issue Oct 27, 2021 · 2 comments
Open

Very high memory usage #820

tysonzero opened this issue Oct 27, 2021 · 2 comments

Comments

@tysonzero
Copy link

Memory usage for GHCJS is getting problematically large, specifically north of 30GB.

It seems like it may have gotten worse in our upgrade from 8.6 to 8.10 as well.

Is there a good way to find out why it's so high and reduce it?

@amesgen
Copy link

amesgen commented Oct 27, 2021

Seconding this. For Ormolu Live, I also had to disable the stack size limit (+RTS -K0) (otherwise the linking step would fail).

If one just wants to check that the code compiles via GHCJS, but not actually produce the JS (useful for CI), skipping the linking step via -no-code helps a lot (as this is where GHCJS uses enormous amounts of memory).

See here for our haskell.nix config: https://github.com/tweag/ormolu/blob/1eec90541c36f7a296352249a0ed147d3a1a6791/default.nix#L32_L33

@ddssff
Copy link
Contributor

ddssff commented Jan 25, 2022

I'd like to point out pikajude/html-entity#2, which is a pull request for a change to a simple package that reduces the size of one ghcjs object file by about 99.8% (really) and fixes an out of memory error we were having. I'm using ghcjs-8.6.0.1, I'd be interested to hear the results for more recent compilers. Maybe this could point the way towards diagnosing this memory issue? It also reduces the size of the ghc object file by 95%.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants