JVM memory usage is limited by your java heap configuration. GC will kick in to keep it within the bound but the JVM will try to use whatever you configure as the max.
Patrick On Tue, Jul 24, 2018 at 4:27 AM Alex Dzyoba <alex.dzy...@gmail.com> wrote: > I forgot to mention that I'm using Zookeeper version 3.5.3-beta > On Tue, Jul 24, 2018 at 2:16 PM Alex Dzyoba <alex.dzy...@gmail.com> wrote: > > > > Hi, > > > > Could someone shed some light on why Zookeeper eats that much memory? > > I have a cluster of 3 with 11 million znodes in it and `mntr` tells me > > that the approximate data size is 9GB (9019066201 precisely) and the > > snapshot size on disk is 9.3 GB. But the JVM itself eats a whopping > > 26GB of RAM. > > > > Here is the jstat output for my leader instance: > > > > S0C S1C S0U S1U EC EU OC OU > > MC MU CCSC CCSU YGC YGCT FGC FGCT GCT > > 0.0 114688.0 0.0 114688.0 12058624.0 11141120.0 19193856.0 > > 16508964.9 17024.0 16305.7 1920.0 1701.6 728 68.993 0 > > 0.000 68.993 > > > > If we sum usage for all spaces (S0U + S1U + EU + OU + MU + CCSU) it > > will be 26 GB. > > > > Why is there such mismatch between zookeeper approximate data size of > > 9GB and actual JVM usage (26GB)? Even if we count only G1 old space > > it's still 16 GB memory usage. > > > > I use openjdk 1.8.0_141 with G1GC. > > > > Thanks! >