<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    人在江湖

      BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
      82 Posts :: 10 Stories :: 169 Comments :: 0 Trackbacks

    轉(zhuǎn)載自: http://www.java-tips.org/java-se-tips/java.util/using-weakhashmap-for-listener-lists.html

    In the Java platform, there are four types of references to objects. Direct references are the type you normally use, as in:

    Object obj = new Object()

    You can think of direct references as strong references that require no extra coding to create or access the object. The remaining three types of references are subclasses of the Reference class found in the java.lang.ref package. Soft references are provided by the SoftReference class, weak references by the WeakReference class, and phantom references by PhantomReference.

     
    Soft references act like a data cache. When system memory is low, the garbage collector can arbitrarily free an object whose only reference is a soft reference. In other words, if there are no strong references to an object, that object is a candidate for release. The garbage collector is required to release any soft references before throwing an OutOfMemoryException.


    Weak references are weaker than soft references. If the only references to an object are weak references, the garbage collector can reclaim the memory used by an object at any time. There is no requirement for a low memory situation. Typically, memory used by the object is reclaimed in the next pass of the garbage collector.


    Phantom references relate to cleanup tasks. They offer a notification immediately before the garbage collector performs the finalization process and frees an object. Consider it a way to do cleanup tasks within an object.

    posted on 2011-01-30 18:11 人在江湖 閱讀(355) 評論(0)  編輯  收藏 所屬分類: java
    主站蜘蛛池模板: 我要看免费的毛片| 免费在线观看毛片| 亚洲av日韩专区在线观看| www.亚洲一区| 午夜老司机永久免费看片| 亚洲码欧美码一区二区三区| 久久久久亚洲AV综合波多野结衣 | 国产精品久久久久久久久久免费 | 亚洲伊人久久大香线蕉AV| 亚洲日韩在线观看免费视频| 99久久精品免费精品国产| 亚洲乱妇熟女爽到高潮的片| 亚洲中文字幕视频国产| 午夜福利不卡片在线播放免费| 国产亚洲福利精品一区二区| 亚洲综合久久综合激情久久| 日韩亚洲精品福利| 免费看h片的网站| 国产无遮挡又黄又爽免费网站| 2020天堂在线亚洲精品专区| 国产精品亚洲精品日韩已满| 日韩在线免费播放| 2021在线观看视频精品免费| 国产免费伦精品一区二区三区| 亚洲色欲色欱wwW在线| 久久精品亚洲视频| 亚洲精品久久久www| 18禁超污无遮挡无码免费网站国产 | 全黄性性激高免费视频| 亚洲免费视频网址| 182tv免费视频在线观看| 国产精品亚洲二区在线| 亚洲一卡2卡3卡4卡乱码 在线| 久久精品亚洲综合专区| 亚洲国产一区视频| 免费看www视频| 丁香花免费高清视频完整版| 少妇太爽了在线观看免费视频| 美女网站在线观看视频免费的| jzzijzzij在线观看亚洲熟妇| 久久精品国产亚洲AV蜜臀色欲|