Strange behavior of "-with-rtsopts=-T

Vlatko Basic vlatko.basic at gmail.com
Wed Jun 5 09:52:48 UTC 2019


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



More information about the ghc-devs mailing list