nomyx / Nomyx

The Nomyx game
83 stars 9 forks source link

Nomyx uses a lot of memory #141

Open cdupont opened 7 years ago

cdupont commented 7 years ago

On program startup:

$ grep 'VmSize' /proc/8924/status                     
VmSize:   832000 kB

832M is a lot of RAM. Each time I submit a rule, it increases memory consumption by 100Mo. So the game RAM size quickly grows to several gigas.

cdupont commented 7 years ago

Possible sources of memory consumption:

If I remove the call to hint interpret (in https://github.com/cdupont/Nomyx/blob/master/Nomyx-Core/src/Nomyx/Core/Engine/Interpret.hs): VmSize = 450 Mo on startup Submitting new rules does not augment the VmSize.

cdupont commented 7 years ago

To see some graphs:

$ stack build  --library-profiling --executable-profiling --ghc-options="-fprof-auto -rtsopts"
$ stack exec -- nomyx-server +RTS -hm -p
$ hp2ps -e8in -c nomyx-server.hp
$ evince nomyx-server.ps

However profiling does not work with the GHC interpreter embedded, so the result is not extremely useful.

It won't run with less then 1300K of heap:

$ stack exec -- Nomyx +RTS -K1300K