89377

Cassandra eats memory

I have Cassandra 2.1 and following properties set:

MAX_HEAP_SIZE="5G" HEAP_NEWSIZE="800M" memtable_allocation_type: heap_buffers

top utility shows that cassandra eats 14.6G virtual memory:

KiB Mem: 16433148 total, 16276592 used, 156556 free, 22920 buffers KiB Swap: 16777212 total, 0 used, 16777212 free. 9295960 cached Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 23120 cassand+ 20 0 14.653g 5.475g 29132 S 318.8 34.9 27:07.43 java

It also dies with various OutOfMemoryError exceptions when I am accessing it from Spark.

How I can prevent this "OutOfMemoryErrors" and reduce memory usage?

Answer1:

Cassandra do eat to much memory but it can be controlled but tuning the GC [Garbage Collection] setting.

GC parameters are contained in the bin/cassandra.in.sh file in the JAVA_OPTS variable.

you can apply these settings in JAVA_OPTS

-XX:+UseConcMarkSweepGC -XX:ParallelCMSThreads=1 -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycleMin=0 -XX:CMSIncrementalDutyCycle=10

Or instead of specifying MAX_HEAP_SIZE and HEAP_NEWSIZE these parameter let cassandra'script specify these parameter Because it will assign best values for these parameter.

Recommend

  • power of 2 with shr and shl - Assembly
  • qemu-system-aarch64 exit from within the guest system
  • How to do bit striping on pixel data?
  • Crc16 To String
  • Getting memory leaks in Glib/GDBus code?
  • What does this Descriptor's init do?
  • How to use SORT to move blank lines to the end of the file?
  • Do I need to explicitly include a common header file(in an include path folder) used in shared libra
  • Detect which script causes server overload - apache + php
  • How to to parallelize the matrix transpose?
  • ocaml llvm kaleidoscope tutorial “Unbound module LlvmExecutionEngine”
  • Default route for all extreme situations
  • jquery ajax bug
  • difference between three development modes in rails
  • Catching UnknownHostException of RetrievalUrl in WorldWindJava 2.1 in Netbeans
  • DNS of the server where ASP.NET application is run
  • Using hibernate 2nd level cache or query cache for lazy fetch queries
  • In Ember.js, what's the difference between store save and store commit?
  • Windows 10 Bluetooth Gatt Client ValueChanged issue
  • Why can't pass only 1 coulmn to glmnet when it is possible in glm function in R?
  • Matlab Generating a Matrix
  • Functions returning a const value [duplicate]
  • XMLHttpRequest in IE-7
  • how to handle onLoad Event on img tag and others
  • Error: java.util.Arrays$ArrayList cannot be cast to java.util.ArrayList
  • C++ exception safety paranoia: how much is too much?
  • Teradata Database 3130 Response limit exceeded?
  • How do I create shared library using ld?
  • Selection Sort, For Java
  • PWA with multiple pages
  • Find VMID for running instance
  • How to resolve permission denied maybe missing internet permission?
  • rewrite uppercase url to lowercase url htaccess
  • Access variable of ScriptContext using Nashorn JavaScript Engine (Java 8)
  • How Lists (specifically, RecyclerView with CardViews) in Android work
  • Code in Job's Script Block after Start-Process Does not Execute
  • Add sale price programmatically to product variations
  • Busy indicator not showing up in wpf window [duplicate]
  • Python/Django TangoWithDjango Models and Databases
  • Net Present Value in Excel for Grouped Recurring CF