Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5915E9C8A for ; Thu, 14 Jun 2012 03:48:53 +0000 (UTC) Received: (qmail 76663 invoked by uid 500); 14 Jun 2012 03:48:50 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 76636 invoked by uid 500); 14 Jun 2012 03:48:50 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 76614 invoked by uid 99); 14 Jun 2012 03:48:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2012 03:48:49 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of al@ooyala.com designates 209.85.215.44 as permitted sender) Received: from [209.85.215.44] (HELO mail-lpp01m010-f44.google.com) (209.85.215.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2012 03:48:42 +0000 Received: by lagv3 with SMTP id v3so967873lag.31 for ; Wed, 13 Jun 2012 20:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ooyala.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=+Xs3sowdKZZe2FAKRKnnYjwdoueY+tWqUNoHBrdPY60=; b=A2/qkPZTEgRYTPUBngPlgeHNs0j+0dV8I5+GCJmVBJ1nd9v9r3UGt63OpqMW4Ufxxs jQRVIhRXOvM6DKYM0PJ+lM4MnT4FIhu16QV2kZstUeajiGnUvoYk8VnES4UjmO4mb466 kWlC1XFRR0IvGfMB1O6NxcVXJc7P5kNGE0iyI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=+Xs3sowdKZZe2FAKRKnnYjwdoueY+tWqUNoHBrdPY60=; b=hJb2rdYMo1y79MlBylDaowvsqTPSnK7c2uBmM0Up2flP+OiWtOdsr3G6TVTV1uNgqX QtoQS1OQLfy/xAGiDED8WIxhqAlgu2sJWasJ4lsQ7xHTOU5XIgo11HF/vilwVEzmvUZw yGCS1Ma1qZQQVsvck4Kpw08EcwzW1MqZA8NhAS07P/sfUrTaffLhJ0BQr3ZrsN+OkFnS A+LL3gcKU9nbG1wPQttrRnjgVlH3SO5gJvzyhTyPh4B9Y33gGegI/6TH1RLr4Y7OehoN C+orbkXbkNf4zQ/ZTLn6+FovlBGoRNGzZ2WQGHDSqzD9l2vRzEJ4GlY7IxW1Hc4vaE7A lJ9A== MIME-Version: 1.0 Received: by 10.152.48.6 with SMTP id h6mr252688lan.30.1339645701887; Wed, 13 Jun 2012 20:48:21 -0700 (PDT) Received: by 10.112.103.100 with HTTP; Wed, 13 Jun 2012 20:48:21 -0700 (PDT) In-Reply-To: References: <9941E72F-D8FA-4F60-A8BD-261AD566F4F1@thelastpickle.com> Date: Wed, 13 Jun 2012 20:48:21 -0700 Message-ID: Subject: Re: Much more native memory used by Cassandra then the configured JVM heap size From: Al Tobey To: user@cassandra.apache.org Cc: "Poziombka, Wade L" Content-Type: multipart/alternative; boundary=bcaec55242422f94ea04c26692bc X-Gm-Message-State: ALoCoQlZHEYPou4qSrAS6oiZTsWB44WR8Qe13x/LnCYXb5UrH9ofikTaknSN033DLj61ykUhrx6T --bcaec55242422f94ea04c26692bc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Linux's default on busy IO boxes is to use all available memory for cache. Try "echo 1 > /proc/sys/vm/drop_caches" and see if your memory comes back (this will drop vfs caches, and in my experience is safe, but YMMV). If your memory comes back, everything is normal and you should leave it alone. It may block for a while if you have a lot of unflushed pages, this is expected. Try setting /proc/sys/vm/dirty_ratio lower if you notice around 20% of your memory is being consumed for "dirty" (written pages not flushed to storage) memory. I usually run all of my systems at 5 or lower. 20 is too high for large memory servers IMO. -Al On Wed, Jun 13, 2012 at 11:01 AM, Poziombka, Wade L < wade.l.poziombka@intel.com> wrote: > actually, this is without jna.jar. I will add and see if still have > same issue**** > > ** ** > > *From:* Poziombka, Wade L > *Sent:* Wednesday, June 13, 2012 10:53 AM > *To:* user@cassandra.apache.org > *Subject:* RE: Much more native memory used by Cassandra then the > configured JVM heap size**** > > ** ** > > Seems like my only recourse is to remove jna.jar and just take the > performance/swapping pain?**** > > ** ** > > Obviously can=E2=80=99t have the entire box lock up. I can provide a pma= p etc. if > needed.**** > > ** ** > > *From:* Poziombka, Wade L [mailto:wade.l.poziombka@intel.com] > > *Sent:* Wednesday, June 13, 2012 10:28 AM > *To:* user@cassandra.apache.org > *Subject:* RE: Much more native memory used by Cassandra then the > configured JVM heap size**** > > ** ** > > I have experienced the same issue. The Java heap seems fine but > eventually the OS runs out of heap. In my case it renders the entire box > unusable without a hard reboot. Console shows:**** > > ** ** > > is there a way to limit the native heap usage?**** > > ** ** > > xfs invoked oom-killer: gfp_mask=3D0x201d2, order=3D0, oomkilladj=3D0**** > > ** ** > > Call Trace:**** > > [] out_of_memory+0x8e/0x2f3**** > > [] __wake_up+0x38/0x4f**** > > [] __alloc_pages+0x27f/0x308**** > > [] __do_page_cache_readahead+0x96/0x17b**** > > [] filemap_nopage+0x14c/0x360**** > > [] __handle_mm_fault+0x1fd/0x103b**** > > [] __wake_up+0x38/0x4f**** > > [] do_page_fault+0x499/0x842**** > > [] audit_filter_syscall+0x87/0xad**** > > [] error_exit+0x0/0x84**** > > ** ** > > Node 0 DMA per-cpu: empty**** > > Node 0 DMA32 per-cpu: empty**** > > Node 0 Normal per-cpu:**** > > cpu 0 hot: high 186, batch 31 used:23**** > > cpu 0 cold: high 62, batch 15 used:14**** > > =E2=80=A6**** > > cpu 23 cold: high 62, batch 15 used:8**** > > Node 1 HighMem per-cpu: empty**** > > Free pages: 158332kB (0kB HighMem)**** > > Active:16225503 inactive:1 dirty:0 writeback:0 unstable:0 free:39583 > slab:21496 **** > > Node 0 DMA free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB**** > > present:0kB**** > > lowmem_reserve[]: 0 0 32320 32320**** > > Node 0 DMA32 free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB***= * > > present:0**** > > lowmem_reserve[]: 0 0 32320 32320**** > > Node 0 Normal free:16136kB min:16272kB low:20340kB high:24408kB > active:3255624**** > > ** ** > > ** ** > > *From:* aaron morton [mailto:aaron@thelastpickle.com] > > *Sent:* Tuesday, June 12, 2012 4:08 AM > *To:* user@cassandra.apache.org > *Subject:* Re: Much more native memory used by Cassandra then the > configured JVM heap size**** > > ** ** > > see http://wiki.apache.org/cassandra/FAQ#mmap**** > > ** ** > > which cause the OS low memory.**** > > If the memory is used for mmapped access the os can get it back > later. **** > > ** ** > > Is the low free memory causing a problem ?**** > > ** ** > > Cheers**** > > ** ** > > ** ** > > -----------------**** > > Aaron Morton**** > > Freelance Developer**** > > @aaronmorton**** > > http://www.thelastpickle.com**** > > ** ** > > On 12/06/2012, at 5:52 PM, Jason Tang wrote:**** > > ** ** > > Hi**** > > ** ** > > I found some information of this issue**** > > And seems we can have other strategy for data access to reduce mmap usage= , > in order to use less memory.**** > > ** ** > > But I didn't find the document to describe the parameters for Cassandra > 1.x, is it a good way to use this parameter to reduce shared memory usage > and what's the impact? (btw, our data model is dynamical, which means the > although the through put is high, but the life cycle of the data is short= , > one hour or less).**** > > ** ** > > "**** > > # Choices are auto, standard, mmap, and mmap_index_only.**** > > disk_access_mode: auto**** > > "**** > > ** ** > > http://comments.gmane.org/gmane.comp.db.cassandra.user/7390 **** > > 2012/6/12 Jason Tang **** > > See my post, I limit the HVM heap 6G, but actually Cassandra will use mor= e > memory which is not calculated in JVM heap. **** > > ** ** > > I use top to monitor total memory used by Cassandra.**** > > ** ** > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D**** > > -Xms6G -Xmx6G -Xmn1600M**** > > ** ** > > 2012/6/12 Jeffrey Kesselman **** > > Btw. I suggest you spin up JConsole as it will give you much more detai > kon what your VM is actually doing.**** > > > > **** > > On Mon, Jun 11, 2012 at 9:14 PM, Jason Tang wrote:*= * > ** > > Hi**** > > ** ** > > We have some problem with Cassandra memory usage, we configure the JVM > HEAP 6G, but after runing Cassandra for several hours (insert, update, > delete). The total memory used by Cassandra go up to 15G, which cause the > OS low memory.**** > > So I wonder if it is normal to have so many memory used by cassandra?**** > > ** ** > > And how to limit the native memory used by Cassandra?**** > > ** ** > > ** ** > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D**** > > Cassandra 1.0.3, 64 bit jdk.**** > > ** ** > > Memory ocupied by Cassandra 15G**** > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND**** > > 9567 casadm 20 0 28.3g 15g 9.1g S 269 65.1 385:57.65 java**** > > ** ** > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D**** > > -Xms6G -Xmx6G -Xmn1600M**** > > ** ** > > # ps -ef | grep 9567**** > > casadm 9567 1 55 Jun11 ? 05:59:44 /opt/jdk1.6.0_29/bin/java > -ea -javaagent:/opt/dve/cassandra/bin/../lib/jamm-0.2.5.jar > -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=3D42 -Xms6G -Xmx6G > -Xmn1600M -XX:+HeapDumpOnOutOfMemoryError -Xss128k -XX:+UseParNewGC > -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio= =3D8 > -XX:MaxTenuringThreshold=3D1 -XX:CMSInitiatingOccupancyFraction=3D75 > -XX:+UseCMSInitiatingOccupancyOnly -Djava.net.preferIPv4Stack=3Dtrue > -Dcom.sun.management.jmxremote.port=3D6080 > -Dcom.sun.management.jmxremote.ssl=3Dfalse > -Dcom.sun.management.jmxremote.authenticate=3Dfalse > -Daccess.properties=3D/opt/dve/cassandra/conf/access.properties > -Dpasswd.properties=3D/opt/dve/cassandra/conf/passwd.properties > -Dpasswd.mode=3DMD5 -Dlog4j.configuration=3Dlog4j-server.properties > -Dlog4j.defaultInitOverride=3Dtrue -cp > /opt/dve/cassandra/bin/../conf:/opt/dve/cassandra/bin/../build/classes/ma= in:/opt/dve/cassandra/bin/../build/classes/thrift:/opt/dve/cassandra/bin/..= /lib/Cassandra-Extensions-1.0.0.jar:/opt/dve/cassandra/bin/../lib/antlr-3.2= .jar:/opt/dve/cassandra/bin/../lib/apache-cassandra-1.0.3.jar:/opt/dve/cass= andra/bin/../lib/apache-cassandra-clientutil-1.0.3.jar:/opt/dve/cassandra/b= in/../lib/apache-cassandra-thrift-1.0.3.jar:/opt/dve/cassandra/bin/../lib/a= vro-1.4.0-fixes.jar:/opt/dve/cassandra/bin/../lib/avro-1.4.0-sources-fixes.= jar:/opt/dve/cassandra/bin/../lib/commons-cli-1.1.jar:/opt/dve/cassandra/bi= n/../lib/commons-codec-1.2.jar:/opt/dve/cassandra/bin/../lib/commons-lang-2= .4.jar:/opt/dve/cassandra/bin/../lib/compress-lzf-0.8.4.jar:/opt/dve/cassan= dra/bin/../lib/concurrentlinkedhashmap-lru-1.2.jar:/opt/dve/cassandra/bin/.= ./lib/guava-r08.jar:/opt/dve/cassandra/bin/../lib/high-scale-lib-1.1.2.jar:= /opt/dve/cassandra/bin/../lib/jackson-core-asl-1.4.0.jar:/opt/dve/cassandra= /bin/../lib/jackson-mapper-asl-1.4.0.jar:/opt/dve/cassandra/bin/../lib/jamm= -0.2.5.jar:/opt/dve/cassandra/bin/../lib/jline-0.9.94.jar:/opt/dve/cassandr= a/bin/../lib/json-simple-1.1.jar:/opt/dve/cassandra/bin/../lib/libthrift-0.= 6.jar:/opt/dve/cassandra/bin/../lib/log4j-1.2.16.jar:/opt/dve/cassandra/bin= /../lib/servlet-api-2.5-20081211.jar:/opt/dve/cassandra/bin/../lib/slf4j-ap= i-1.6.1.jar:/opt/dve/cassandra/bin/../lib/slf4j-log4j12-1.6.1.jar:/opt/dve/= cassandra/bin/../lib/snakeyaml-1.6.jar:/opt/dve/cassandra/bin/../lib/snappy= -java-1.0.4.1.jar > org.apache.cassandra.thrift.CassandraDaemon**** > > ** ** > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D**** > > # nodetool -h 127.0.0.1 -p 6080 info**** > > Token : 85070591730234615865843651857942052864**** > > Gossip active : true**** > > Load : 20.59 GB**** > > Generation No : 1339423322**** > > Uptime (seconds) : 39626**** > > Heap Memory (MB) : 3418.42 / 5984.00**** > > Data Center : datacenter1**** > > Rack : rack1**** > > Exceptions : 0**** > > ** ** > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D**** > > All row cache and key cache are disabled by default**** > > ** ** > > Key cache: disabled**** > > Row cache: disabled**** > > ** ** > > ** ** > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D**** > > ** ** > > # pmap 9567**** > > 9567: java**** > > START SIZE RSS PSS DIRTY SWAP PERM MAPPING**** > > 0000000040000000 36K 36K 36K 0K 0K r-xp > /opt/jdk1.6.0_29/bin/java**** > > 0000000040108000 8K 8K 8K 8K 0K rwxp > /opt/jdk1.6.0_29/bin/java**** > > 000000004010a000 18040K 17988K 17988K 17988K 0K rwxp [heap]**** > > 000000067ae00000 6326700K 6258664K 6258664K 6258664K 0K rwxp [anon]*= * > ** > > 00000007fd06b000 48724K 0K 0K 0K 0K rwxp [anon]**** > > 00007fbed1530000 1331104K 0K 0K 0K 0K r-xs > /var/cassandra/data/drc/queue-hb-219-Data.db**** > > 00007fbf22918000 2097152K 0K 0K 0K 0K r-xs > /var/cassandra/data/drc/queue-hb-219-Data.db**** > > 00007fbfa2918000 2097148K 1124464K 1124462K 0K 0K r-xs > /var/cassandra/data/drc/queue-hb-219-Data.db**** > > 00007fc022917000 2097156K 2096496K 2096492K 0K 0K r-xs > /var/cassandra/data/drc/queue-hb-219-Data.db**** > > 00007fc0a2918000 2097148K 2097148K 2097146K 0K 0K r-xs > /var/cassandra/data/drc/queue-hb-219-Data.db**** > > 00007fc1a2917000 733584K 6444K 6444K 0K 0K r-xs > /var/cassandra/data/drc/queue-hb-109-Data.db**** > > 00007fc1cf57b000 2097148K 20980K 20980K 0K 0K r-xs > /var/cassandra/data/drc/queue-hb-109-Data.db**** > > 00007fc24f57a000 2097152K 456480K 456478K 0K 0K r-xs > /var/cassandra/data/drc/queue-hb-109-Data.db**** > > 00007fc2cf57a000 2097156K 1168320K 1168318K 0K 0K r-xs > /var/cassandra/data/drc/queue-hb-109-Data.db**** > > 00007fc34f57b000 2097148K 1177520K 1177520K 0K 0K r-xs > /var/cassandra/data/drc/queue-hb-109-Data.db**** > > 00007fc405629000 618708K 338248K 338248K 0K 0K r-xs > /var/cassandra/data/drc/queue-hb-230-Data.db**** > > 00007fc42b25e000 620388K 289024K 289024K 0K 0K r-xs > /var/cassandra/data/drc/queue-hb-224-Data.db**** > > 00007fc451037000 619160K 342108K 342108K 0K 0K r-xs > /var/cassandra/data/drc/queue-hb-216-Data.db**** > > 00007fc62b7df000 132696K 0K 0K 0K 0K r-xs > /var/cassandra/data/drc/queue.idxInQueueTime-hb-175-Data.db**** > > 00007fc6de8e0000 132696K 0K 0K 0K 0K r-xs > /var/cassandra/data/drc/queue.idxRecvTime-hb-175-Data.db**** > > 00007fc6f2bcc000 52492K 0K 0K 0K 0K r-xs > /var/cassandra/data/drc/queue.idxPartitionId-hb-211-Data.db**** > > 00007fc6f64dc000 43784K 40840K 40840K 0K 0K r-xs > /var/cassandra/data/drc/fpr_index-hb-91-Data.db**** > > 00007fc707ca6000 68968K 37724K 37724K 0K 0K r-xs > /var/cassandra/data/drc/queue-hb-219-Index.db**** > > 00007fc70c000000 2468K 2436K 2436K 2436K 0K rwxp [anon]**** > > 00007fc70c269000 63068K 0K 0K 0K 0K ---p [anon]**** > > 00007fc710b9e000 52888K 0K 0K 0K 0K r-xs > /var/cassandra/data/drc/queue.idxInQueueTime-hb-216-Data.db**** > > 00007fc713f44000 52952K 0K 0K 0K 0K r-xs > /var/cassandra/data/drc/queue.idxFireTimeRange-hb-140-Data.db**** > > 00007fc7172fa000 52952K 0K 0K 0K 0K r-xs > /var/cassandra/data/drc/queue.idxFireTime-hb-140-Data.db**** > > 00007fc71bd13000 162992K 162984K 162984K 0K 0K r-xs > /var/cassandra/data/drc/fpr_index-hb-80-Data.db**** > > 00007fc725c3f000 52952K 28712K 28712K 0K 0K r-xs > /var/cassandra/data/drc/queue.idxInQueueTimeRange-hb-140-Data.db**** > > 00007fc728ff5000 52952K 0K 0K 0K 0K r-xs > /var/cassandra/data/drc/queue.idxRecvTimeRange-hb-140-Data.db**** > > 00007fc72d026000 52480K 0K 0K 0K 0K r-xs > /var/cassandra/data/drc/queue.idxRecvTimeRange-hb-211-Data.db**** > > 00007fc730366000 52564K 0K 0K 0K 0K r-xs > /var/cassandra/data/drc/queue.idxStatus-hb-196-Data.db**** > > 00007fc7336bb000 22348K 0K 0K 0K 0K r-xs > /var/cassandra/data/drc/queue.idxInQueueTime-hb-175-Index.db**** > > ** ** > > ** ** > > BRs**** > > //Ares Tang**** > > > > **** > > > -- > It's always darkest just before you are eaten by a grue.**** > > ** ** > > ** ** > > ** ** > --bcaec55242422f94ea04c26692bc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Linux's default on busy IO boxes is to use all available memory for cac= he. Try "echo 1 > /proc/sys/vm/drop_caches" and see if your me= mory comes back (this will drop vfs caches, and in my experience is safe, b= ut YMMV).

If your memory comes back, everything is normal and you shou= ld leave it alone. =C2=A0It may block for a while if you have a lot of unfl= ushed pages, this is expected. Try setting /proc/sys/vm/dirty_ratio lower i= f you notice around 20% of your memory is being consumed for "dirty&qu= ot; (written pages not flushed to storage) memory. I usually run all of my = systems at 5 or lower. 20 is too high for large memory servers IMO.

-Al

On Wed, Ju= n 13, 2012 at 11:01 AM, Poziombka, Wade L <wade.l.poziombka@intel= .com> wrote:

actually, this is without= jna.jar.=C2=A0 I will add and see if still have same issue

=C2=A0

From: Poziombk= a, Wade L

Sent: Wednesday, June 13, 2012 10:53 AM
To: u= ser@cassandra.apache.org
Subject: RE: Much more native memory used by Cassandra then the conf= igured JVM heap size

=C2=A0

Seems like my only recour= se is to remove jna.jar and just take the performance/swapping pain?=

=C2=A0

Obviously can=E2=80=99t h= ave the entire box lock up.=C2=A0 I can provide a pmap etc. if needed.

=C2=A0

From: Poziombk= a, Wade L [= mailto:wade.l.poziombka@intel.com]

Sent: Wednesday, June 13, 2012 10:28 AM
To: u= ser@cassandra.apache.org
Subject: RE: Much more native memory used by Cassandra then th= e configured JVM heap size

=C2=A0

I have experienced the sa= me issue.=C2=A0 The Java heap seems fine but eventually the OS runs out of = heap.=C2=A0 In my case it renders the entire box unusable without a hard reboot.=C2=A0 Console shows:

=C2=A0

is there a way to limit t= he native heap usage?

=C2=A0

xfs invoked oom-killer: gfp_mask=3D0x201d2, order=3D0, oomkilladj=3D0<=
u>
=C2=A0
Call Trace:
 [<ffffffff800c9d3a>] out_of_memory+0x8e/0x2f3
 [<ffffffff8002dfd7>] __wake_up+0x38/0x4f
 [<ffffffff8000f677>] __alloc_pages+0x27f/0x308
 [<ffffffff80013034>] __do_page_cache_readahead+0x96/0x17b
 [<ffffffff80013971>] filemap_nopage+0x14c/0x360
 [<ffffffff8000896c>] __handle_mm_fault+0x1fd/0x103b
 [<ffffffff8002dfd7>] __wake_up+0x38/0x4f
 [<ffffffff800671f2>] do_page_fault+0x499/0x842
 [<ffffffff800b8f39>] audit_filter_syscall+0x87/0xad
 [<ffffffff8005dde9>] error_exit+0x0/0x84
=C2=A0
Node 0 DMA per-cpu: empty
Node 0 DMA32 per-cpu: empty
Node 0 Normal per-cpu:
cpu 0 hot: high 186, batch 31 used:23
cpu 0 cold: high 62, batch 15 used:14

=E2=80=A6

cpu 23 cold: high 62, batch 15 used:8=

Node 1 HighMem per-cpu: empty

Free pages:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 158332kB (0kB Hi= ghMem)

Active:16225503 inactive:1 dirty:0 writeback:0 unstable:0 = free:39583 slab:21496

Node 0 DMA free:0kB min:0kB low:0kB high:0kB active:0kB in= active:0kB

present:0kB

lowmem_reserve[]: 0 0 32320 32320

Node 0 DMA32 free:0kB min:0kB low:0kB high:0kB active:0kB = inactive:0kB

present:0

lowmem_reserve[]: 0 0 32320 32320

Node 0 Normal free:16136kB min:16272kB low:20340kB high:24= 408kB active:3255624

=C2=A0

=C2=A0

From: aaron mo= rton [mailto:a= aron@thelastpickle.com]
Sent: Tuesday, June 12, 2012 4:08 AM
To: u= ser@cassandra.apache.org
Subject: Re: Much more native memory used by Cassandra then the conf= igured JVM heap size

=C2=A0

see=C2=A0http://wiki.apache.org/cassandra/FAQ#mmap<= u>

=C2=A0

which cause the OS low memory.

If the memory is used for mmapped access the os can = get it back later.=C2=A0

=C2=A0

Is the low free memory causing a problem ?=

=C2=A0

Cheers

=C2=A0

=C2=A0

-----------------

Aaron Morton

Freelance Developer

@aaronmorton

=C2=A0

On 12/06/2012, at 5:52 PM, Jason Tang wrote:<= u>

=C2=A0<= /p>

Hi

=C2=A0

I found some information of this issue=

And seems we can have other strategy for data access= to reduce mmap usage, in order to use less memory.

=C2=A0

But I didn't find the document to describe the p= arameters for Cassandra 1.x, is it a good way to use this parameter to redu= ce shared memory usage and what's the impact? (btw, our data model is d= ynamical, which means the although the through put is high, but the life cycle of the data is short, one hour or less).

=C2=A0

"

# Choices are auto, standard, mmap, and mmap_index_o= nly.

disk_access_mode: auto

"

=C2=A0

http:/= /comments.gmane.org/gmane.comp.db.cassandra.user/7390=C2=A0

2012/6/12 Jason Tang <ares.tang@gmail.com>

See my post, I limit the HVM heap 6G, but actually C= assandra will use more memory which is not calculated in JVM heap.=C2=A0=

=C2=A0

I use top to monitor total memory used by Cassandra.=

=C2=A0

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

-Xms6G -Xmx6G -Xmn1600M

=C2=A0

2012/6/12 Jeffrey Kesselman <jeffpk@gmail.com>

Btw.=C2=A0 I suggest you spin up JConsole as it will= give you much more detai kon what your VM is actually doing.=



=C2=A0

On Mon, Jun 11, 2012 at 9:14 PM, Jason Tang <ares.tang@gmail.com> wrote:

Hi

=C2=A0

We have some problem with Cassandra memory usage, we= configure the JVM HEAP 6G, but after runing Cassandra for several hours (i= nsert, update, delete). The total memory used by Cassandra go up to 15G, wh= ich cause the OS low memory.

So I wonder if it is normal to have so many memory u= sed by cassandra?

=C2=A0

=C2=A0 =C2=A0 =C2=A0 =C2=A0 And how to limit the nat= ive memory used by Cassandra?

=C2=A0

=C2=A0

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Cassandra 1.0.3, 64 bit jdk.

=C2=A0

Memory ocupied by Cassandra 15G

=C2=A0 PID USER =C2=A0 =C2=A0 =C2=A0PR =C2=A0NI =C2= =A0VIRT =C2=A0RES =C2=A0SHR S %CPU %MEM =C2=A0 =C2=A0TIME+ =C2=A0COMMAND=

=C2=A09567 casadm =C2=A0 =C2=A020 =C2=A0 0 28.3g =C2= =A015g 9.1g S =C2=A0269 65.1 385:57.65 java

=C2=A0

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

-Xms6G -Xmx6G -Xmn1600M

=C2=A0

=C2=A0# ps -ef | grep =C2=A09567

casadm =C2=A0 =C2=A09567 =C2=A0 =C2=A0 1 55 Jun11 ? = =C2=A0 =C2=A0 =C2=A0 =C2=A005:59:44 /opt/jdk1.6.0_29/bin/java -ea -javaagen= t:/opt/dve/cassandra/bin/../lib/jamm-0.2.5.jar -XX:+UseThreadPriorities -XX= :ThreadPriorityPolicy=3D42 -Xms6G -Xmx6G -Xmn1600M -XX:+HeapDumpOnOutOfMemo= ryError -Xss128k -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEn= abled -XX:SurvivorRatio=3D8 -XX:MaxTenuringThreshold=3D1 -XX:CMSInitiatingO= ccupancyFraction=3D75 -XX:+UseCMSInitiatingOccupancyOnly -Djava.net.preferI= Pv4Stack=3Dtrue -Dcom.sun.management.jmxremote.port=3D6080 -Dcom.sun.management.jmxremote.ssl=3Dfalse -Dcom.sun.management.jmxremote.= authenticate=3Dfalse -Daccess.properties=3D/opt/dve/cassandra/conf/access.p= roperties -Dpasswd.properties=3D/opt/dve/cassandra/conf/passwd.properties -= Dpasswd.mode=3DMD5 -Dlog4j.configuration=3Dlog4j-server.properties -Dlog4j.defaultInitOverride=3Dtrue -cp /opt/dve/cassandra/bin/../conf:/opt= /dve/cassandra/bin/../build/classes/main:/opt/dve/cassandra/bin/../build/cl= asses/thrift:/opt/dve/cassandra/bin/../lib/Cassandra-Extensions-1.0.0.jar:/= opt/dve/cassandra/bin/../lib/antlr-3.2.jar:/opt/dve/cassandra/bin/../lib/ap= ache-cassandra-1.0.3.jar:/opt/dve/cassandra/bin/../lib/apache-cassandra-cli= entutil-1.0.3.jar:/opt/dve/cassandra/bin/../lib/apache-cassandra-thrift-1.0= .3.jar:/opt/dve/cassandra/bin/../lib/avro-1.4.0-fixes.jar:/opt/dve/cassandr= a/bin/../lib/avro-1.4.0-sources-fixes.jar:/opt/dve/cassandra/bin/../lib/com= mons-cli-1.1.jar:/opt/dve/cassandra/bin/../lib/commons-codec-1.2.jar:/opt/d= ve/cassandra/bin/../lib/commons-lang-2.4.jar:/opt/dve/cassandra/bin/../lib/= compress-lzf-0.8.4.jar:/opt/dve/cassandra/bin/../lib/concurrentlinkedhashma= p-lru-1.2.jar:/opt/dve/cassandra/bin/../lib/guava-r08.jar:/opt/dve/cassandr= a/bin/../lib/high-scale-lib-1.1.2.jar:/opt/dve/cassandra/bin/../lib/jackson= -core-asl-1.4.0.jar:/opt/dve/cassandra/bin/../lib/jackson-mapper-asl-1.4.0.= jar:/opt/dve/cassandra/bin/../lib/jamm-0.2.5.jar:/opt/dve/cassandra/bin/../= lib/jline-0.9.94.jar:/opt/dve/cassandra/bin/../lib/json-simple-1.1.jar:/opt= /dve/cassandra/bin/../lib/libthrift-0.6.jar:/opt/dve/cassandra/bin/../lib/l= og4j-1.2.16.jar:/opt/dve/cassandra/bin/../lib/servlet-api-2.5-20081211.jar:= /opt/dve/cassandra/bin/../lib/slf4j-api-1.6.1.jar:/opt/dve/cassandra/bin/..= /lib/slf4j-log4j12-1.6.1.jar:/opt/dve/cassandra/bin/../lib/snakeyaml-1.6.ja= r:/opt/dve/cassandra/bin/../lib/snappy-java-1.0.4.1.jar org.apache.cassandra.thrift.CassandraDaemon

=C2=A0

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

# nodetool -h 127.0.0.1 -p 6080 info

Token =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0: 850= 70591730234615865843651857942052864

Gossip active =C2=A0 =C2=A0: true

Load =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 : 20.= 59 GB

Generation No =C2=A0 =C2=A0: 1339423322

Uptime (seconds) : 39626

Heap Memory (MB) : 3418.42 / 5984.00

Data Center =C2=A0 =C2=A0 =C2=A0: datacenter1=

Rack =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 : rac= k1

Exceptions =C2=A0 =C2=A0 =C2=A0 : 0

=C2=A0

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

All row cache and key cache are disabled by default<= u>

=C2=A0

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 Key cache: disabled

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 Row cache: disabled

=C2=A0

=C2=A0

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=C2=A0

# pmap 9567

9567: java

START =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 SIZE =C2=A0 =C2=A0 RSS =C2=A0 =C2=A0 PSS =C2=A0 DIRTY =C2=A0 =C2=A0SWAP= PERM MAPPING

0000000040000000 =C2=A0 =C2=A0 36K =C2=A0 =C2=A0 36K= =C2=A0 =C2=A0 36K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xp /opt/= jdk1.6.0_29/bin/java

0000000040108000 =C2=A0 =C2=A0 =C2=A08K =C2=A0 =C2= =A0 =C2=A08K =C2=A0 =C2=A0 =C2=A08K =C2=A0 =C2=A0 =C2=A08K =C2=A0 =C2=A0 = =C2=A00K rwxp /opt/jdk1.6.0_29/bin/java

000000004010a000 =C2=A018040K =C2=A017988K =C2=A0179= 88K =C2=A017988K =C2=A0 =C2=A0 =C2=A00K rwxp [heap]

000000067ae00000 6326700K 6258664K 6258664K 6258664K= =C2=A0 =C2=A0 =C2=A00K rwxp [anon]

00000007fd06b000 =C2=A048724K =C2=A0 =C2=A0 =C2=A00K= =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K rwxp = [anon]

00007fbed1530000 1331104K =C2=A0 =C2=A0 =C2=A00K =C2= =A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var= /cassandra/data/drc/queue-hb-219-Data.db

00007fbf22918000 2097152K =C2=A0 =C2=A0 =C2=A00K =C2= =A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var= /cassandra/data/drc/queue-hb-219-Data.db

00007fbfa2918000 2097148K 1124464K 1124462K =C2=A0 = =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var/cassandra/data/drc/queue-h= b-219-Data.db

00007fc022917000 2097156K 2096496K 2096492K =C2=A0 = =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var/cassandra/data/drc/queue-h= b-219-Data.db

00007fc0a2918000 2097148K 2097148K 2097146K =C2=A0 = =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var/cassandra/data/drc/queue-h= b-219-Data.db

00007fc1a2917000 733584K =C2=A0 6444K =C2=A0 6444K = =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var/cassandra/data/drc/= queue-hb-109-Data.db

00007fc1cf57b000 2097148K =C2=A020980K =C2=A020980K = =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var/cassandra/data/drc/= queue-hb-109-Data.db

00007fc24f57a000 2097152K 456480K 456478K =C2=A0 =C2= =A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var/cassandra/data/drc/queue-hb-1= 09-Data.db

00007fc2cf57a000 2097156K 1168320K 1168318K =C2=A0 = =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var/cassandra/data/drc/queue-h= b-109-Data.db

00007fc34f57b000 2097148K 1177520K 1177520K =C2=A0 = =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var/cassandra/data/drc/queue-h= b-109-Data.db

00007fc405629000 618708K 338248K 338248K =C2=A0 =C2= =A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var/cassandra/data/drc/queue-hb-2= 30-Data.db

00007fc42b25e000 620388K 289024K 289024K =C2=A0 =C2= =A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var/cassandra/data/drc/queue-hb-2= 24-Data.db

00007fc451037000 619160K 342108K 342108K =C2=A0 =C2= =A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var/cassandra/data/drc/queue-hb-2= 16-Data.db

00007fc62b7df000 132696K =C2=A0 =C2=A0 =C2=A00K =C2= =A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var= /cassandra/data/drc/queue.idxInQueueTime-hb-175-Data.db

00007fc6de8e0000 132696K =C2=A0 =C2=A0 =C2=A00K =C2= =A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var= /cassandra/data/drc/queue.idxRecvTime-hb-175-Data.db

00007fc6f2bcc000 =C2=A052492K =C2=A0 =C2=A0 =C2=A00K= =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs = /var/cassandra/data/drc/queue.idxPartitionId-hb-211-Data.db

00007fc6f64dc000 =C2=A043784K =C2=A040840K =C2=A0408= 40K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var/cassandra/data/= drc/fpr_index-hb-91-Data.db

00007fc707ca6000 =C2=A068968K =C2=A037724K =C2=A0377= 24K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var/cassandra/data/= drc/queue-hb-219-Index.db

00007fc70c000000 =C2=A0 2468K =C2=A0 2436K =C2=A0 24= 36K =C2=A0 2436K =C2=A0 =C2=A0 =C2=A00K rwxp [anon]

00007fc70c269000 =C2=A063068K =C2=A0 =C2=A0 =C2=A00K= =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K ---p = [anon]

00007fc710b9e000 =C2=A052888K =C2=A0 =C2=A0 =C2=A00K= =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs = /var/cassandra/data/drc/queue.idxInQueueTime-hb-216-Data.db

00007fc713f44000 =C2=A052952K =C2=A0 =C2=A0 =C2=A00K= =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs = /var/cassandra/data/drc/queue.idxFireTimeRange-hb-140-Data.db=

00007fc7172fa000 =C2=A052952K =C2=A0 =C2=A0 =C2=A00K= =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs = /var/cassandra/data/drc/queue.idxFireTime-hb-140-Data.db

00007fc71bd13000 162992K 162984K 162984K =C2=A0 =C2= =A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var/cassandra/data/drc/fpr_index-= hb-80-Data.db

00007fc725c3f000 =C2=A052952K =C2=A028712K =C2=A0287= 12K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs /var/cassandra/data/= drc/queue.idxInQueueTimeRange-hb-140-Data.db

00007fc728ff5000 =C2=A052952K =C2=A0 =C2=A0 =C2=A00K= =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs = /var/cassandra/data/drc/queue.idxRecvTimeRange-hb-140-Data.db=

00007fc72d026000 =C2=A052480K =C2=A0 =C2=A0 =C2=A00K= =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs = /var/cassandra/data/drc/queue.idxRecvTimeRange-hb-211-Data.db=

00007fc730366000 =C2=A052564K =C2=A0 =C2=A0 =C2=A00K= =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs = /var/cassandra/data/drc/queue.idxStatus-hb-196-Data.db

00007fc7336bb000 =C2=A022348K =C2=A0 =C2=A0 =C2=A00K= =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K =C2=A0 =C2=A0 =C2=A00K r-xs = /var/cassandra/data/drc/queue.idxInQueueTime-hb-175-Index.db<= /p>

=C2=A0

=C2=A0

BRs

//Ares Tang




--
It's always darkest just before you are eaten by a grue.<= /p>

=C2=A0

=C2=A0

=C2=A0


--bcaec55242422f94ea04c26692bc--