[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.memory-analyzer] Re: Classes from rt.jar loaded by different loaders ?

Hi Satish,

your example will not work this way - the VM knows that your are not referencing s, v, ss, or the list after the Thread.sleep(). It will garbage collect those items.

String s = new String("satish");
Vector v = new Vector(10);
ServerSocket ss = new ServerSocket();
ConcurrentLinkedQueue list = new ConcurrentLinkedQueue();
System.out.println("TestCL...");
Thread.sleep(100000000);


Probably all class loaders reference the Vector from the system class loader.

Take this example: the class loader (not loaded by the system class loader itself) references a hash table.

Class Name ---------------------------------------------------------------------
com.foo.loader.ResourceMultiParentClassLoader @ 0xa8d6338 |- <class> class com.foo.loader.ResourceMultiParentClassLoader @ 0xe38e780
|- parent sun.misc.Launcher$AppClassLoader @ 0xa8c3710 |- package2certs java.util.Hashtable @ 0xa8d63d8 |- classes java.util.Vector @ 0xa8d6400 ---------------------------------------------------------------------


If you have a question how to interpret a particular view of the Memory Analyzer, just go ahead and Ctrl-C the selected lines and copy and paste it to the forum.

Andreas.