top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Is there any tool to detect memory leaks in Java (with JNI)

+2 votes
736 views

I am looking for a free/open source tool to identify memory leaks in my JNI program.
I am using : java version "1.6.0_45", Java HotSpot(TM) 64-Bit Server.

Any suggestions?

posted Jun 19, 2013 by Sudheendra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

The first thing i'd do is run with -Xcheck:jni on and see if it comes up with anything.

If you're on a Sun JVM, i think you can do -XX:TraceJNICalls to get an overwhelming listing of JNI calls as they happen. That should let you get an idea of what calls are being made, and from there work towards what is making them, and why this is causing a problem.

answer Jun 20, 2013 by anonymous
Similar Questions
+2 votes

I was playing around some static inner class.

    package com.tutorial; 
    public class MyUpperClass {
        private MyUpperClass () {

        }
        private static class MyStaticInnerClass{
                    private static final MyUpperClass muc = new MyUpperClass ();
        }
        public static MyUpperClass getInstance() {
            return MyStaticInnerClass.muc;
        }
    }

Now, My question is, when does MystaticInnerClass get loaded into the JVM memory?
At the time of, when MyUpperClass get loaded or getInstance() get called?

...