//Callback URL that tells the WebView to load this activity when it finishes with twitter.com. (see manifest)
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_twitter);

You are trying to connect to LDAP(SSL) from a Java Program as follows:
...
prop.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
...prop.put(Context.PROVIDER_URL, "ldap://host:636/OU=My Org,DC=domain,DC=com");
LdapContext ctx =new InitialLdapContext(prop,null);
...

First get the Java Applications Process Id, one way to do this is with: jps

jmap -dump:format=b,file=dump.bin <javaProcessIdHere>

The size of the heap dump file will be same as the heap memory in use at the time the command is run. For large heap sizes this can take several minutes to run, and can stall (make it unresponsive) the application during this time.

To get a summary of Object Instances and Sizes you can use this command:

jmap -histo:live <javaProcessIdHere>

Generally, this command will run quickly, and should be used when taking a heap dump will be too costly in terms of time-taken/size etc.

To get Heap Dump on Out of Memory Exception (available from Java 1.5.0_07 onwards):

Add the following param: -XX:+HeapDumpOnOutOfMemoryError

If you want the dump to go in a particular path then add: -XX:+HeapDumpOnOutOfMemoryError XX:HeapDumpPath=/usr/local/dumps

To initiate Heap Dump from within the Application Code:

We can also use jmap from our code. To get a pid from code use we need to use java.lang.management.ManagementFactory.String name = ManagementFactory.getRuntimeMXBean().getName();String pid = name.substring(0, name.indexOf("@"));After that we can start jmap process like this:String[] cmd = { "jmap", "-dump:file=/usr/local/heapdumps/dump.bin", pid };Process p = Runtime.getRuntime().exec(cmd);

If you have the following JVM options:
-XX:NewSize=nnn -XX:MaxNewSize=mmm Then you will get Memory (Heap) usage graph as follows:

Without the NewSize options, you will get Memory (Heap) usage graph as follows:

What does this indicate?In the first case short-lived objects are allowed to grow in Eden Space until it gets full, and then Full GC happens.In the Second case minor GC keeps happening frequently, and short-lived objects are GC’ed frequently.

While loading a Spring Context XML file i get the following error:
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document …because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not

Solution
This error is caused by the fact that the XSD being referred is not found (either because it does not exist OR there is no internet connection).

1. Download the XSD and place it in your Classpath.
2. In the xsi:schemaLocation=”…” section of your Spring Context file, change the path to XSD from http to classpath.

For eg: Lets say you want to see only those queries coming via a JDBC Thin Driver, you can do:select LAST_LOAD_TIME, ELAPSED_TIME, MODULE, SQL_TEXT elasped from v$sql
WHERE MODULE='JDBC Thin Client'
ORDER BY LAST_LOAD_TIME DESC