Skip to content

System hangs and crashes after consuming all 32GB of RAM #286

Closed
@codygman

Description

@codygman

Problem

My and my team's system information My system information:
haskell-language-server 0.2.2.0 compiled from source with Nix
AMD Ryzen 7 3800X 8-Core @3.5472 GHz
haskell-language-server version: 0.2.2.0
Linux 5.7.2, NixOS, 20.09pre229574.0a146054bdf (Nightingale)

My teammates system information:

haskell-language-server 0.2.2.0 compiled from source with Nix
AMD Ryzen 7 3800X 8-Core @3.5472 GHz
32GB Ram
Ubuntu 20.04 LTS
haskell-language-server version: 0.2.2.0 (same pinned nix channel)

I get system hangs a 4-6 times per month and many require hard rebooting the system. One teammate I convinced to finally try haskell-language-server had his machine crash twice this past Friday.

These are pretty beefy machines Ubuntu and NixOS machines with 32GB of ram and AMD Ryzen 7 3800X 8-Core @3.5472 GHz.

Project GHC Version and size:

ghc-8.8.3 with stack/stackage lts-16.6

$ cloc .
    1140 text files.
    1140 unique files.                                          
       1 file ignored.

github.com/AlDanial/cloc v 1.86  T=0.23 s (4893.6 files/s, 397089.8 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Haskell                       1138          11632           3153          76751
Markdown                         1            282              0            605
-------------------------------------------------------------------------------
SUM:                          1139          11914           3153          77356
-------------------------------------------------------------------------------

This project also has 77 template Haskell splices, with the majority I think being aesonQQ splices.

Some profiling information

I don't have any memory usage information, but I can see the 4 files with mkPersistent blocks take about 3.8 seconds to typecheck. I'm guessing that probably equates to higher memory usage too.

I know some improved memory usage work for template Haskell was done at some point, perhaps my revision isn't new enough to have that?

Nix install info

Uses this fork of hls-nix to build haskell-language-server. I might be able to create a test project that you can just do nix-shell --pure --run "haskell-language-server" from to debug the same build if needed when I get time.

I attempted to use static binaries but have separate issues with those and would prefer to focus on the performance issue before spending time debugging the static binary issue. So the above nix-based hls install is the only one I've been able to get working for this project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceIssues about memory consumption, responsiveness, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions