> I want to use valgrind to detect memory leaks for a library in Java native 
 > interface.
 > For this I made a sample program by pressing a key reserve memory and another
 > pressing the release and one for exiting the program.
 >
 > I have 2 problems:
 > * If I activate the options to detect memory leaks I see too many failures.

Please tell us how many (within a few percent), and post (copy+paste)
two complete example complaints.

 > * I can not detect which are memory leaks in my library.

Please give an example, and explain why not.  Do your routines have names?
Do those names appear in the complaints from memcheck?

 >
 > Option for valgrind:
 > valgrind --smc-check=all --trace-children=yes --show-leak-kinds=all 
 > --track-origins=yes -v --leak-check=yes java -Djava.library.path=. App

Please state the version of valgrind ("valgrind --version"),
and the hardware architecture, and the operating system and version.

 >
 > Is there any way to filter leaks only my library?

If you can determine which are in your library, then encode that knowledge
into a filter (using python, perl, sed, awk, ...).  However, in general a leak
results from a misunderstanding about some interface or software contract.
Usually there are at least two pieces of software involved in creating a leak:
the allocator and the non-free()r.  The leak "belongs" to the combination
of all of the pieces.

 > Do the choices I am using to search for leaks is right for Java native code?

We cannot say until you post verbatim examples of the output that you get.



------------------------------------------------------------------------------
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to