I tried running a Java program (or another program that uses a just-in-time compiler) under Valgrind but something went wrong. Does Valgrind handle such programs?
Valgrind can handle dynamically generated code, so long as none of the generated code is later overwritten by other generated code. If this happens, though, things will go wrong as Valgrind will continue running its translations of the old code (this is true on x86 and amd64, on PowerPC there are explicit cache flush instructions which Valgrind detects and honours). You should try running with –smc-check=all in this case. Valgrind will run much more slowly, but should detect the use of the out-of-date code. Alternatively, if you have the source code to the JIT compiler you can insert calls to the VALGRIND_DISCARD_TRANSLATIONS client request to mark out-of-date code, saving you from using –smc-check=all. Apart from this, in theory Valgrind can run any Java program just fine, even those that use JNI and are partially implemented in other languages like C and C++. In practice, Java implementations tend to do nasty things that most programs do not, and Valgrind sometimes falls over these
Related Questions
- If I amdebugging a program that uses
to interact with the user,in which windowdo I enter the text so that the program running in PerlWiz canread from the keyboard? - My EBI windows become corrupted when running the Java plug-in in Internet Explorer 5.5. Whats wrong?
- Is it possible to attach Valgrind to a program that is already running?