Valgrind and Java

I want to use Valgrind 3.7 0 to find a memory leak in my java native code I'm using jdk1 6.0._ twenty-nine

To do this, I must set the – trace children = yes flag With this flag set, I can no longer run Valgrind on any Java application, or even the following command:

valgrind --trace-children=yes --smc-check=all java -version

You will receive an error message:

Error occurred during initialization of VM
   UnkNown x64 processor: SSE2 not supported

I read this link: https://bugs.kde.org/show_bug.cgi?id=249943 , but it didn't work

Running the program without Valgrind or without - Trace children flag is a fine

What does someone have in mind and can do?

Solution

You must disable JIT to run the JVM under Valgrind, as follows:

valgrind java -Djava.compiler=NONE ...

In addition, if you end up using generated suppression (and most likely!), The depth of the generated suppressed call stack may be problematic, which is more likely to occur when running under the JVM

In the latest version of Valgrind, the generated suppression can contain a deeper call stack than handled by Valgrind / MemCheck itself The symptom of this problem is that Valgrind terminates unexpectedly and the message "too many callers in the stack trace"

This problem is easy to fix: edit the file coreprint / m before building Valgrind_ errormgr. C and change the hard coded value in #define to a larger value (I use 99):

/* maximum number of callers in suppressed context. */

#define VG_MAX_SUPP_CALLERS  99

Then build and install Valgrind. Net according to the documentation

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>