Skip to content

Add memory usage logs #1493

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

Closed
mpickering opened this issue Mar 4, 2021 · 0 comments · Fixed by #1508
Closed

Add memory usage logs #1493

mpickering opened this issue Mar 4, 2021 · 0 comments · Fixed by #1508
Labels
performance Issues about memory consumption, responsiveness, etc. type: enhancement New feature or request

Comments

@mpickering
Copy link
Contributor

As I suggested on IRC

9:15 AM  <mpickering> Has anyone actually looked into why hls "uses a lot of memory", seems like a lot of people complain about it 
9:15 AM <mpickering> Just knowing some RTS metrics, heap size and live bytes would be informative
9:16 AM <mpickering> Perhaps can build with `--with-rtsopts=-T` and then periodically dump some heap stats to the log
9:16 AM <mpickering> so if someone complains then there are numbers
9:17 AM <mpickering> You would expect heap size to be about 2 * live bytes
9:17 AM <mpickering> but I suspect that it isn't

Stats can be read from https://hackage.haskell.org/package/base-4.14.1.0/docs/GHC-Stats.html

Then a test could also be added to CI which described some desirable properties of memory usage over time. (Something like this test)

@jneira jneira added type: enhancement New feature or request performance Issues about memory consumption, responsiveness, etc. type: testing labels Mar 4, 2021
mpickering added a commit to mpickering/haskell-language-server that referenced this issue Mar 6, 2021
A thread is spawned which at a prespecified interval will report the
live bytes and heap size at the last major collection.

Live bytes corresponds to how much live data a program has and should
match closely the value reported during heap profiling.

Heap size reports the total amount of memory the RTS is using, which
corresponds more closely to OS memory usage.

```
[INFO] Live bytes: 367.45MB Heap size: 676.33MB
```

Closes haskell#1493
mpickering added a commit to mpickering/haskell-language-server that referenced this issue Mar 6, 2021
A thread is spawned which at a prespecified interval will report the
live bytes and heap size at the last major collection.

Live bytes corresponds to how much live data a program has and should
match closely the value reported during heap profiling.

Heap size reports the total amount of memory the RTS is using, which
corresponds more closely to OS memory usage.

```
[INFO] Live bytes: 367.45MB Heap size: 676.33MB
```

Closes haskell#1493
mpickering added a commit to mpickering/haskell-language-server that referenced this issue Mar 6, 2021
A thread is spawned which at a prespecified interval will report the
live bytes and heap size at the last major collection.

Live bytes corresponds to how much live data a program has and should
match closely the value reported during heap profiling.

Heap size reports the total amount of memory the RTS is using, which
corresponds more closely to OS memory usage.

```
[INFO] Live bytes: 367.45MB Heap size: 676.33MB
```

Closes haskell#1493
mpickering added a commit to mpickering/haskell-language-server that referenced this issue Mar 20, 2021
A thread is spawned which at a prespecified interval will report the
live bytes and heap size at the last major collection.

Live bytes corresponds to how much live data a program has and should
match closely the value reported during heap profiling.

Heap size reports the total amount of memory the RTS is using, which
corresponds more closely to OS memory usage.

```
[INFO] Live bytes: 367.45MB Heap size: 676.33MB
```

Closes haskell#1493
mpickering added a commit to mpickering/haskell-language-server that referenced this issue Jul 23, 2021
A thread is spawned which at a prespecified interval will report the
live bytes and heap size at the last major collection.

Live bytes corresponds to how much live data a program has and should
match closely the value reported during heap profiling.

Heap size reports the total amount of memory the RTS is using, which
corresponds more closely to OS memory usage.

```
[INFO] Live bytes: 367.45MB Heap size: 676.33MB
```

Closes haskell#1493
Anton-Latukha added a commit to Anton-Latukha/haskell-language-server that referenced this issue Dec 19, 2021
A thread is spawned which at a prespecified interval will report the
live bytes and heap size at the last major collection.

Live bytes corresponds to how much live data a program has and should
match closely the value reported during heap profiling.

Heap size reports the total amount of memory the RTS is using, which
corresponds more closely to OS memory usage.

```
[INFO] Live bytes: 367.45MB Heap size: 676.33MB
```

Closes haskell#1493
Anton-Latukha added a commit to Anton-Latukha/haskell-language-server that referenced this issue Dec 19, 2021
A thread is spawned which at a prespecified interval will report the
live bytes and heap size at the last major collection.

Live bytes corresponds to how much live data a program has and should
match closely the value reported during heap profiling.

Heap size reports the total amount of memory the RTS is using, which
corresponds more closely to OS memory usage.

```
[INFO] Live bytes: 367.45MB Heap size: 676.33MB
```

Closes haskell#1493

Author:     Matthew Pickering <[email protected]>
Anton-Latukha added a commit to Anton-Latukha/haskell-language-server that referenced this issue Dec 20, 2021
A thread is spawned which at a prespecified interval will report the
live bytes and heap size at the last major collection.

Live bytes corresponds to how much live data a program has and should
match closely the value reported during heap profiling.

Heap size reports the total amount of memory the RTS is using, which
corresponds more closely to OS memory usage.

```
[INFO] Live bytes: 367.45MB Heap size: 676.33MB
```

Closes haskell#1493

Author:     Matthew Pickering <[email protected]>
@mergify mergify bot closed this as completed in #1508 Dec 20, 2021
mergify bot pushed a commit that referenced this issue Dec 20, 2021
* Log live_bytes and heap_size as reported by GHC.Stats

A thread is spawned which at a prespecified interval will report the
live bytes and heap size at the last major collection.

Live bytes corresponds to how much live data a program has and should
match closely the value reported during heap profiling.

Heap size reports the total amount of memory the RTS is using, which
corresponds more closely to OS memory usage.

```
[INFO] Live bytes: 367.45MB Heap size: 676.33MB
```

Closes #1493

* Update ghcide/ghcide.cabal

Co-authored-by: Jan Hrcek <[email protected]>

Co-authored-by: Pepe Iborra <[email protected]>
Co-authored-by: Jan Hrcek <[email protected]>
Co-authored-by: Javier Neira <[email protected]>
Co-authored-by: wz1000 <[email protected]>
Co-authored-by: Anton Latukha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issues about memory consumption, responsiveness, etc. type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants