This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cleantutorials.jconsole.memory; | |
/** | |
* Dog represents a dog which can be uniquely identified by the MicroChip ID and | |
* can optionally have a name. | |
*/ | |
public class Dog { | |
/** The Unique MicroChip ID of the dog. */ | |
private int microChipID; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jmap -dump:live,file=<file-name + .hprof> <pid> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StackTraceExample { | |
public static void main(String[] args) { | |
StackTraceExample example = new StackTraceExample(); | |
example.method1(); | |
} | |
public void method1() { | |
method2(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Github Link: https://github.com/cleantutorials/JConsole/blob/master/src/main/java/com/cleantutorials/jconsole/thread/DeadlockExample.java | |
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.221-b11 mixed mode): | |
"DestroyJavaVM" #13 prio=5 os_prio=0 tid=0x0000000002402800 nid=0x31a8 waiting on condition [0x0000000000000000] | |
java.lang.Thread.State: RUNNABLE | |
"Thread-1" #12 prio=5 os_prio=0 tid=0x000000001d841800 nid=0x7ef4 waiting for monitor entry [0x000000001f5af000] | |
java.lang.Thread.State: BLOCKED (on object monitor) | |
at com.cleantutorials.jconsole.thread.DeadlockExample$2.run(DeadlockExample.java:40) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cleantutorials.jconsole.jmx; | |
public class JMXTutorial implements JMXTutorialMBean { | |
private int noOfStudents; | |
public int getNoOfStudents() { | |
return noOfStudents; | |
} | |
public void setNoOfStudents(int noOfStudents) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cleantutorials.jconsole.jmx; | |
public interface JMXTutorialMBean { | |
public int getNoOfStudents(); // Reading the value of the attribute (Getter method) | |
public void setNoOfStudents(int x); // Writing the value of the attribute (Setter Method) | |
public void incrementNoOfStudents(); // Any operation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cleantutorials.jconsole.jmx; | |
import java.lang.management.ManagementFactory; | |
import javax.management.InstanceAlreadyExistsException; | |
import javax.management.MBeanRegistrationException; | |
import javax.management.MBeanServer; | |
import javax.management.MalformedObjectNameException; | |
import javax.management.NotCompliantMBeanException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cleantutorials.jconsole.jmx; | |
public class RemoteJavaProcess { | |
public static void main(String[] args) throws InterruptedException { | |
System.out.println("Ready for incomming connections from JConsole."); | |
Thread.sleep(600000); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
admin readwrite | |
guest readonly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
admin password1 | |
guest password2 |
OlderNewer