I use gloss to create an RTS game in Haskell, but I noticed that even a very simple program will take up more and more memory as it starts up. The following program, for example, will gradually increase memory usage (it will require ~ 0.025 MB per second).
module Main ( main ) where import Graphics.Gloss import Graphics.Gloss.Interface.IO.Game main = playIO (InWindow "glossmem" (500, 500) (0,0)) white 10 0 (\world -> return (translate (-250) 0 (text $ show world))) (\event -> (\world -> return world)) (\timePassed -> (\world -> return $ world + timePassed))
I tried to limit the heap size at runtime, but it just crashes the program when it reaches the limit. I am worried that this behavior will become a performance issue when I have a more complex world, is there a way to use shine so that it is not a problem? Or am I using the wrong tool to work?
source share