Hi, my Logstash (7.6.2) instance have some memory leak.
Xms and Xms are set on 512m, I have 1 very simple pipeline rest->simple map->elastic - this pipeline is executed few times in hour.
Logstash after up starting to increase used memory. After 5-6h logstash exhausts all my physical memory (4GB+0,5GB swap), thread is killed and logstash automatically starting again.
VisualVM looks good
Logstash working on RPi4 with 4GB of ram on adoptopenjdk-8-hotspot-armhf and Raspbian Buster.
GC logs looks also good, only in logs on debug I have same records every few seconds:
[DEBUG][logstash.instrument.periodicpoller.cgroup.cpuresource] File /sys/fs/cgroup/cpu/cpu.cfs_period_us cannot be found, try providing an override 'ls.cgroup.cpu.path.override' in the Logstash JAVA_OPTS environment variable
[DEBUG][logstash.instrument.periodicpoller.cgroup.cpuresource] File /sys/fs/cgroup/cpu/cpu.cfs_quota_us cannot be found, try providing an override 'ls.cgroup.cpu.path.override' in the Logstash JAVA_OPTS environment variable
[DEBUG][logstash.instrument.periodicpoller.cgroup.cpuresource] File /sys/fs/cgroup/cpu/cpu.stat cannot be found, try providing an override 'ls.cgroup.cpu.path.override' in the Logstash JAVA_OPTS environment variable
[DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=>"ParNew"}
[DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=>"ConcurrentMarkSweep"}
[DEBUG][org.logstash.execution.PeriodicFlush][mailgun] Pushing flush onto pipeline.
When memory ends I get dump in my syslog:
kernel: [137863.046945] Hardware name: Raspberry Pi 4 Model B Rev 1.2 (DT)
kernel: [137863.046949] Call trace:
kernel: [137863.046958] dump_backtrace+0x0/0x178
kernel: [137863.046961] show_stack+0x24/0x30
kernel: [137863.046968] dump_stack+0xa4/0xdc
kernel: [137863.046974] dump_header+0x64/0x248
kernel: [137863.046978] oom_kill_process+0x320/0x370
kernel: [137863.046982] out_of_memory+0xf8/0x308
kernel: [137863.046985] __alloc_pages_nodemask+0xda0/0xe38
kernel: [137863.046989] filemap_fault+0x430/0x590
kernel: [137863.046995] ext4_filemap_fault+0x38/0x58
kernel: [137863.047000] __do_fault+0x58/0x120
kernel: [137863.047003] __handle_mm_fault+0x800/0xb28
kernel: [137863.047006] handle_mm_fault+0x130/0x238
kernel: [137863.047011] do_page_fault+0x1c0/0x498
kernel: [137863.047015] do_translation_fault+0xa8/0xb8
kernel: [137863.047019] do_mem_abort+0x68/0x128
kernel: [137863.047022] el0_da+0x20/0x24
kernel: [137863.047025] Mem-Info:
kernel: [137863.047034] active_anon:649585 inactive_anon:259500 isolated_anon:0
kernel: [137863.047034] active_file:523 inactive_file:1122 isolated_file:71
kernel: [137863.047034] unevictable:2068 dirty:0 writeback:2 unstable:0
kernel: [137863.047034] slab_reclaimable:16240 slab_unreclaimable:18722
kernel: [137863.047034] mapped:3258 shmem:16120 pagetables:3817 bounce:0
kernel: [137863.047034] free:6904 free_pcp:0 free_cma:963
kernel: [137863.047042] Node 0 active_anon:2598340kB inactive_anon:1038000kB active_file:2092kB inactive_file:4488kB unevictable:8272kB isolated(anon):0kB isolated(file):284kB mapped:13032kB dirty:0kB writeback:8kB shmem:64480kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
kernel: [137863.047050] DMA32 free:15340kB min:3744kB low:4680kB high:5616kB active_anon:739272kB inactive_anon:66816kB active_file:860kB inactive_file:3052kB unevictable:4368kB writepending:4kB present:970752kB managed:891816kB mlocked:4368kB kernel_stack:464kB pagetables:1668kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:3852kB
kernel: [137863.047053] lowmem_reserve[]: 0 2936 2936
kernel: [137863.047066] Normal free:12276kB min:12636kB low:15792kB high:18948kB active_anon:1859068kB inactive_anon:971184kB active_file:956kB inactive_file:1564kB unevictable:3904kB writepending:4kB present:3080192kB managed:3007256kB mlocked:3904kB kernel_stack:5392kB pagetables:13600kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
kernel: [137863.047069] lowmem_reserve[]: 0 0 0
kernel: [137863.047076] DMA32: 554*4kB (UMEC) 427*8kB (UMEC) 172*16kB (UMEC) 58*32kB (UMEC) 22*64kB (UMEC) 20*128kB (UEC) 4*256kB (UE) 1*512kB (C) 0*1024kB 0*2048kB 0*4096kB = 15744kB
kernel: [137863.047103] Normal: 1527*4kB (UME) 376*8kB (UME) 48*16kB (UME) 19*32kB (UME) 2*64kB (E) 1*128kB (U) 4*256kB (U) 1*512kB (U) 0*1024kB 0*2048kB 0*4096kB = 12284kB
kernel: [137863.047130] 25108 total pagecache pages
kernel: [137863.047134] 6720 pages in swap cache
kernel: [137863.047138] Swap cache stats: add 162998, delete 156275, find 168470/174626
kernel: [137863.047141] Free swap = 0kB
kernel: [137863.047144] Total swap = 524284kB
kernel: [137863.047147] 1012736 pages RAM
kernel: [137863.047150] 0 pages HighMem/MovableOnly
kernel: [137863.047153] 37968 pages reserved
kernel: [137863.047156] 16384 pages cma reserved
kernel: [137863.047159] Tasks state (memory values in pages):
kernel: [137863.047162] [ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name
...
kernel: [137863.047382] [ 3661] 118 3661 279991 141917 2224128 105626 0 java
...
kernel: [137863.047453] [ 27766] 999 27766 777304 656494 5505024 3 0 java
...
kernel: [137863.047847] Out of memory: Kill process 27766 (java) score 594 or sacrifice child
kernel: [137863.047925] Killed process 27766 (java) total-vm:3109216kB, anon-rss:2625976kB, file-rss:0kB, shmem-rss:0kB
kernel: [137863.366369] oom_reaper: reaped process 27766 (java), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
systemd-udevd[153]: 00-3a5000000000: Worker [8754] processing SEQNUM=4196 killed
systemd-udevd[153]: Worker [8754] terminated by signal 9 (KILL)
systemd-udevd[153]: 00-3a5000000000: Worker [8754] failed
systemd-udevd[153]: 00-ba5000000000: Worker [8781] processing SEQNUM=4197 is taking a long time
systemd-udevd[153]: 00-7a5000000000: Worker [8783] processing SEQNUM=4198 is taking a long time
systemd-udevd[153]: 00-065000000000: Worker [8799] processing SEQNUM=4200 is taking a long time
systemd-udevd[153]: 00-fa5000000000: Worker [8794] processing SEQNUM=4199 is taking a long time
systemd-udevd[153]: 00-fa5000000000: Worker [8794] processing SEQNUM=4199 killed
CRON[8795]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
systemd-udevd[153]: Worker [8794] terminated by signal 9 (KILL)
dbus-daemon[363]: [system] Connection has not authenticated soon enough, closing it (auth_timeout=30000ms, elapsed: 44391ms)
systemd-udevd[153]: 00-fa5000000000: Worker [8794] failed
systemd-udevd[153]: 00-065000000000: Worker [8799] processing SEQNUM=4200 killed
smartd[376]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 107 to 108
systemd-udevd[153]: Worker [8799] terminated by signal 9 (KILL)
systemd-udevd[153]: 00-065000000000: Worker [8799] failed
systemd-udevd[153]: 00-865000000000: Worker [8820] processing SEQNUM=4201 is taking a long time
systemd-udevd[153]: 00-865000000000: Worker [8820] processing SEQNUM=4201 killed
systemd-udevd[153]: Worker [8820] terminated by signal 9 (KILL)
systemd-udevd[153]: 00-865000000000: Worker [8820] failed
systemd-udevd[153]: 00-465000000000: Worker [8836] processing SEQNUM=4202 is taking a long time
systemd-udevd[153]: 00-465000000000: Worker [8836] processing SEQNUM=4202 killed
systemd-udevd[153]: Worker [8836] terminated by signal 9 (KILL)
systemd-udevd[153]: 00-465000000000: Worker [8836] failed
systemd-udevd[153]: 00-c65000000000: Worker [8863] processing SEQNUM=4203 is taking a long time
CRON[8860]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
systemd-udevd[153]: 00-265000000000: Worker [8871] processing SEQNUM=4204 is taking a long time
systemd-udevd[153]: 00-c65000000000: Worker [8863] processing SEQNUM=4203 killed
systemd-udevd[153]: Worker [8863] terminated by signal 9 (KILL)
CRON[8868]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
systemd-udevd[153]: 00-c65000000000: Worker [8863] failed
dbus-daemon[363]: [system] Connection has not authenticated soon enough, closing it (auth_timeout=30000ms, elapsed: 57891ms)
systemd-udevd[153]: 00-a65000000000: Worker [8883] processing SEQNUM=4205 is taking a long time
dbus-daemon[363]: [system] Connection has not authenticated soon enough, closing it (auth_timeout=30000ms, elapsed: 119396ms)
systemd-udevd[153]: 00-665000000000: Worker [8883] processing SEQNUM=4206 is taking a long time
systemd-udevd[153]: 00-665000000000: Worker [8883] processing SEQNUM=4206 killed
systemd-udevd[153]: Worker [8883] terminated by signal 9 (KILL)
dbus-daemon[363]: [system] Connection has not authenticated soon enough, closing it (auth_timeout=30000ms, elapsed: 97411ms)
systemd-udevd[153]: 00-e65000000000: Worker [8871] processing SEQNUM=4207 is taking a long time
CRON[8894]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
systemd-udevd[153]: 00-165000000000: Worker [8913] processing SEQNUM=4208 is taking a long time
systemd-udevd[153]: 00-e65000000000: Worker [8871] processing SEQNUM=4207 killed
dbus-daemon[363]: [system] Connection has not authenticated soon enough, closing it (auth_timeout=30000ms, elapsed: 59445ms)
systemd-udevd[153]: Worker [8871] terminated by signal 9 (KILL)
systemd-udevd[153]: 00-e65000000000: Worker [8871] failed
systemd-udevd[153]: 00-165000000000: Worker [8913] processing SEQNUM=4208 killed
CRON[8934]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
systemd-udevd[153]: Worker [8913] terminated by signal 9 (KILL)
systemd-udevd[153]: 00-165000000000: Worker [8913] failed
systemd-udevd[153]: 00-965000000000: Worker [8932] processing SEQNUM=4209 is taking a long time
dbus-daemon[363]: [system] Connection has not authenticated soon enough, closing it (auth_timeout=30000ms, elapsed: 53374ms)
systemd-udevd[153]: 00-965000000000: Worker [8932] processing SEQNUM=4209 killed
systemd-udevd[153]: 00-565000000000: Worker [8936] processing SEQNUM=4210 is taking a long time
dbus-daemon[363]: [system] Connection has not authenticated soon enough, closing it (auth_timeout=30000ms, elapsed: 52022ms)
systemd-udevd[153]: Worker [8932] terminated by signal 9 (KILL)
systemd-udevd[153]: 00-965000000000: Worker [8932] failed
systemd-udevd[153]: 00-565000000000: Worker [8936] processing SEQNUM=4210 killed
systemd-udevd[153]: 00-365000000000: Worker [8955] processing SEQNUM=4212 is taking a long time
systemd-udevd[153]: 00-d65000000000: Worker [8940] processing SEQNUM=4211 is taking a long time
systemd-udevd[153]: Worker [8936] terminated by signal 9 (KILL)
systemd-udevd[153]: 00-365000000000: Worker [8955] processing SEQNUM=4212 killed
systemd-udevd[153]: 00-b65000000000: Worker [8967] processing SEQNUM=4213 is taking a long time
systemd-udevd[153]: Worker [8955] terminated by signal 9 (KILL)
systemd-udevd[153]: 00-365000000000: Worker [8955] failed
systemd-udevd[153]: 00-b65000000000: Worker [8967] processing SEQNUM=4213 killed
systemd-udevd[153]: Worker [8967] terminated by signal 9 (KILL)
systemd-udevd[153]: 00-b65000000000: Worker [8967] failed
systemd[1]: logstash.service: Main process exited, code=killed, status=9/KILL
systemd[1]: logstash.service: Failed with result 'signal'.
systemd-udevd[153]: 00-765000000000: Worker [8940] processing SEQNUM=4214 is taking a long time
systemd-udevd[153]: 00-765000000000: Worker [8940] processing SEQNUM=4214 killed
systemd-udevd[153]: Worker [8940] terminated by signal 9 (KILL)
systemd[1]: logstash.service: Service RestartSec=100ms expired, scheduling restart.
systemd[1]: logstash.service: Scheduled restart job, restart counter is at 6.
systemd[1]: Stopped logstash.