diff --git a/lib/aprsme/packet_consumer.ex b/lib/aprsme/packet_consumer.ex index 731b710..e2d0eff 100644 --- a/lib/aprsme/packet_consumer.ex +++ b/lib/aprsme/packet_consumer.ex @@ -148,9 +148,9 @@ defmodule Aprsme.PacketConsumer do process_info = Process.info(self(), [:memory, :heap_size, :total_heap_size]) # Force garbage collection if memory usage is high - # 10MB threshold (more aggressive than previous 50MB) - # Also check process memory independently - if memory_diff > 10_485_760 or process_info[:memory] > 20_971_520 do + # 500MB threshold for memory diff (we have 15GB available) + # 1GB threshold for process memory + if memory_diff > 524_288_000 or process_info[:memory] > 1_073_741_824 do :erlang.garbage_collect() Logger.warning("High memory usage detected, forced garbage collection", diff --git a/rel/vm.args.eex b/rel/vm.args.eex index 983397a..d9f92b7 100644 --- a/rel/vm.args.eex +++ b/rel/vm.args.eex @@ -2,7 +2,13 @@ ## -mode/-name/-sname/-setcookie are configured via env vars, do not set them here ## Increase number of concurrent ports/sockets -##+Q 65536 ++Q 65536 -## Tweak GC to run more often -##-env ERL_FULLSWEEP_AFTER 10 +## Memory and GC tuning for 1GB container +## Run full sweep less frequently to reduce GC overhead ++e 65536 ++hms 46422 ++hmbs 46422 ++S 2:2 ++stbt s ++zdbbl 32768