Vorlent / cozycast

movie night over the internet
Other
5 stars 3 forks source link

Reduce memory usage #47

Closed Vorlent closed 4 years ago

Vorlent commented 4 years ago

It is well known that the JVM has an awful GC in terms of memory usage. When it runs out of space it only starts garbage collecting after it has reached the maximum configured heap size. If you produce 500MB garbage and the VM has started with 250MB and the max is 1024MB then it will simply increase the heap to 750MB even though if it had started a GC cycle it would have ended up with 250MB again. This awful property of the JVM GC has always been a thorn in my eye. Most people deal with it by simply spending more on hardware but this only works because each web server can handle thousands of users. Cozycast needs an entire server for every dozen people or less and in the self hosted case there may only be 3 users so wasting 2-3GB of ram just isn't feasible.

Vorlent commented 4 years ago

The cozycast-server's memory settings have been reduced to 300MB. Now the cozycast-worker is the only heavy RAM user which can only be solved by switching browsers. (See https://github.com/Vorlent/cozycast/issues/53)