Java 技巧—懒加载
1 | package io.github.binglau; |
1 | package io.github.binglau; |
谈及 GC 自然是需要先谈及如何触发 GC,GC 作为垃圾回收器,自然是需要定义内存中『垃圾』的,那么怎么定义自然就成了关键。总体来说有以下的思路。
Hash table and linked list implementation of the Map interface, with predictable iteration order. This implementation differs fromHashMap in that it maintains a doubly-linked list running through all of its entries. This linked list defines the iteration ordering, which is normally the order in which keys were inserted into the map (insertion-order). Note that insertion order is not affected if a key is re-inserted into the map. (A key k is reinserted into a map m if m.put(k, v) is invoked when m.containsKey(k) would return trueimmediately prior to the invocation.)