I have logstash running in a container.
I set env variables (heap size and debug port)
LS_JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8083 -Xms512m -Xmx512m
and seems they apply in the JVM settings. Here is the full JVM stats:
"jvm" : {
"threads" : {
"count" : 32,
"peak_count" : 32
},
"mem" : {
"heap_used_percent" : 73,
"heap_committed_in_bytes" : 536870912,
"heap_max_in_bytes" : 536870910,
"heap_used_in_bytes" : 396540928,
"non_heap_used_in_bytes" : 165070352,
"non_heap_committed_in_bytes" : 183500800,
"pools" : {
"survivor" : {
"committed_in_bytes" : 27262976,
"max_in_bytes" : -1,
"used_in_bytes" : 26738688,
"peak_max_in_bytes" : -1,
"peak_used_in_bytes" : 33554432
},
"old" : {
"committed_in_bytes" : 242221056,
"max_in_bytes" : 536870912,
"used_in_bytes" : 148552704,
"peak_max_in_bytes" : 536870912,
"peak_used_in_bytes" : 148552704
},
"young" : {
"committed_in_bytes" : 267386880,
"max_in_bytes" : -1,
"used_in_bytes" : 221249536,
"peak_max_in_bytes" : -1,
"peak_used_in_bytes" : 283115520
}
}
},
"gc" : {
"collectors" : {
"old" : {
"collection_count" : 0,
"collection_time_in_millis" : 0
},
"young" : {
"collection_count" : 17,
"collection_time_in_millis" : 1304
}
}
},
"uptime_in_millis" : 3535183
}
}
But when I look in top
, I see it taking 1.4GB (and keeps growing) in RES, and that's even without doing much work:
If it matters, I have a custom java output plugin which I compiled with logstash according to this tutorial.
What's the reason the heap restriction doesn't work?
UPDATE:
I took a heapdump of logstash and its size is 579861862 bytes i.e. 552 MB.
So if not the heap, what's taking the other 1GB out of the 1.5GB being shown in top?