2015年12月25日
摘要: Nested ClassesThe Java programming language allows you to define a class within another class. Such a class is called anested classand is illustrated ... 阅读全文
posted @ 2015-12-25 11:19 gyt929458988 阅读(1721) 评论(0) 推荐(0)
摘要: Static Inner Classes Consider the following Java code fragment: public class A { int y; public static class B { int x; void f () {} } } This fragment 阅读全文
posted @ 2015-12-25 10:30 gyt929458988 阅读(1334) 评论(0) 推荐(0)
  2015年12月24日
摘要: Most people think that volatile variables are for concurrency. In some sense, this intuition is correct. However, the semantics of volatile variables ... 阅读全文
posted @ 2015-12-24 19:38 gyt929458988 阅读(222) 评论(0) 推荐(0)
摘要: Thestd::tr1:shared_ptrclass template is the big and famous sibling of another class template calledstd::tr1::weak_ptr. In this part I introduceweak_pt... 阅读全文
posted @ 2015-12-24 10:25 gyt929458988 阅读(966) 评论(0) 推荐(0)
摘要: For garbage collection (GC) to reclaim objects no longer in use by the program, thelogicallifetime of an object (the time that the application will us... 阅读全文
posted @ 2015-12-24 00:22 gyt929458988 阅读(328) 评论(0) 推荐(0)
  2015年12月23日
摘要: How many times have we created various object instances, and assign those to reference variables? We all know very well that Java has automatic garbag... 阅读全文
posted @ 2015-12-23 17:00 gyt929458988 阅读(254) 评论(0) 推荐(0)
摘要: WeakHashMapis an implementation ofMapinterface where the memory of the value object can be reclaimed by Grabage Collector if the corresponding key is ... 阅读全文
posted @ 2015-12-23 11:22 gyt929458988 阅读(160) 评论(0) 推荐(0)
  2015年12月21日
摘要: Some time ago I was interviewing candidates for a Senior Java Engineer position. Among the many questions I asked was "What can you tell me about weak... 阅读全文
posted @ 2015-12-21 21:59 gyt929458988 阅读(266) 评论(0) 推荐(0)
  2015年12月20日
摘要: In myprevious postwe looked at different categories of ClassLoader leaks, and looked at a particular example of a reference from outside the web appli... 阅读全文
posted @ 2015-12-20 23:00 gyt929458988 阅读(433) 评论(0) 推荐(0)
摘要: I’m planning a series of posts around classloader leaks, also known as PermGen memory leaks. You have probably arrived at this page because your Java ... 阅读全文
posted @ 2015-12-20 17:46 gyt929458988 阅读(409) 评论(0) 推荐(0)