How effective is the GHCs garbage collector (on mobile devices)?

So it should have appeared several thousand times earlier, but I just read this article that details why the garbage collector on Android and iOS is terribly slow.

One of the highlights is that garbage collection is great, as long as there is plenty of space for collectors to work.

My question is: is the use of GHC memory management susceptible to this?

+4
source share
1 answer

This may be, although the overall situation is more complicated. GHC primarily uses a copy collector. GC starts when the heap grows by some amount, currently 2x . Since the copy collector strategy is to copy live objects to a new memory, it is very important that you have free RAM, although this is not the case as shown in this article. An IIRC for GHC of about 2.5-3x is a minimum.

The GHC also provides a sealing manifold that does not require nearly as much additional RAM. The choice between compression and copying schemes is dynamic depending on the memory usage and the RTS -c and -M flags .

+2
source

Source: https://habr.com/ru/post/1493802/


All Articles