How to speed up the execution of java application started by valgrind?

Viewed 209

I am debugging a memory leak issue in a java application with some native code using jna, I am using the Valgrind, I found that the java application started by valgrind run very slowly, I know that application started by valgrind may slow down for 10-50 times than native code in the official documentation, but it is really time-consuming for debugging, in my case I only need to debug the jna native code, is possible to have valgrind ignore the jvm code(libjvm.so) and focus on my native library?

I have the following configuration.

  1. My jna native code is compiled with the gcc options -g and -O0
  2. valgrind is invoked with the parameters valgrind --leak-check=yes --error-limit=no --suppressions=/root/valgrind_errors.txt java -jar xxx.jar
  3. also I tried to recompile JRE with the gcc options -g and -O0, it didn't speed up the execution.

Do you have some suggestions to speed up the execution?

Thanks.

1 Answers
Related