Strange behavior of "-with-rtsopts=-T

Ömer Sinan Ağacan omeragacan at gmail.com
Thu Jun 6 10:22:40 UTC 2019


Hi Vlatko,

Unless this is a side effect of calling getrusage() (perhaps it causes the OS to
update stats) I don't see how this is possible.

Your reproducer seems to require postgres so I'm unable to run it. If you can
provide a version that doesn't need postgres I can take a look.

Ömer

Vlatko Basic <vlatko.basic at gmail.com>, 5 Haz 2019 Çar, 12:53 tarihinde
şunu yazdı:
>
> Hello ghc-devs,
>
> I wrote about this issue to haskell-cafe, but received no reply as of today, so
> I'm hoping I could get some answer(s) here.
>
> I wrote a small Servant server that communicates with the same other server(s).
>
>
> When compiled without "-with-rtsopts=-T", I see in 'gnome-system-monitor' that
> memory used by each server constantly growing.
>
> I was investigating the issue, and found that it is (probably) not in my code,
> but in one http call (Servant client call to the same server).
>
>
> When I compile it with "-with-rtsopts=-T", the memory is constant and steady.
>
> Tested on Arch Linux with Stack LTS 13.14.
>
>
> If any one wants to test this, here are the steps: (server is standalone and
> does not require any external services (like DB, Redis, etc) and uses just a few
> MBs of RAM.)
>
> $ hg clone https://bitbucket.org/vlatkoB/poomas && cd poomas && stack build
>
> ## open your system monitor
>
>
> ## open two terminals in 'poomas' dir and in one run
>
> $ srvb.sh 5
>
> ## and in the other #
>
> $ srvb.sh 6
>
> ## (5 and 6 represent port number added to 3000, i.e. 3005 and 3006)
>
> ## Notice that memory is steady, around 6 MB on my machine.
>
>
> ## In 'server/package.yaml' comment out the line 139 (#-with-rtsopts=-T)
>
> $ stack build --force-dirty
>
> ## start those two servers again and see memory usage growing.
>
>
> Can anyone shed some light what could be happening here?
>
>
> Best regards,
>
> vlatko
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


More information about the ghc-devs mailing list