Skip to content

leonliao/calcite-avatica-driver-version-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

calcite-avatica-driver-version-test

This project demonstrates the memory leak of Avatica's DriverVersion.load

  1. Run mvn package
  2. Upload target/calcite-avatica-driver-version-test-0.1-SNAPSHOT-bin.zip to a Linux CentOS 6.9 machine
  3. Unzip the zip to a folder, cd the folder
  4. Run the ./run.sh.
  5. Then using the jeprof util to monitor the heap by following steps(Verified on Centos 6.9, should work on most Linux-es)
    • wget https://github.com/jemalloc/jemalloc/releases/download/5.1.0/jemalloc-5.1.0.tar.bz2
    • tar xvf jemalloc-5.1.0.tar.bz2
    • cd jemalloc-5.1.0
    • ./configure --enable-prof --prefix=/usr/local
    • make
    • sudo make install
    • Add export MALLOC_CONF="prof:true,lg_prof_sample:1,lg_prof_interval:26,prof_prefix:/{YOUR INTENDED FOLDER}/jeprof.out" to run.sh
    • Add LD_PRELOAD="/usr/local/lib/libjemalloc.so" before the nohup java in run.sh
    • Execute the run.sh to start the test Java main class
    • If in non-GUI Linux, goto the /{YOUR INTENDED FOLDER}/, and run jeprof --show_bytes --dot `which java` jeprof.out.xxxx.heap > avatica_leak_test.dot , jeprof.out.xxxx.heap is the latest heap file generated by jemalloc.
    • Pull the avatica_leak_test.dot to local folder {$somepath}, download graphviz(https://www.graphviz.org/download/), and then run dot -Tpng {$somepath}/avatica_leak_test.dot -o {$somepath}/avatica_leak_test.png
    • More info, can visit https://github.com/jeffgriffith/native-jvm-leaks to learn more

About

Test the memory leak of avatica

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published