}
}
+ public static void debugFlushAll() {
+ for (int i=0;i<3;i++) {
+ try {
+ System.gc();
+ Thread.sleep(100);
+ } catch (InterruptedException x) {
+ }
+ CHandle stale = (CHandle) references.poll();
+ while (stale != null) {
+ try {
+ synchronized (map) {
+ map.remove(stale.p);
+ }
+ stale.release();
+ } catch (Throwable ex) {
+ }
+ stale = (CHandle) references.poll();
+ }
+ }
+ }
+
public static void debugDumpReachable(String title) {
synchronized (map) {
System.out.println(title);
}
public void putAlways(CHandle h) {
- if (size > table.length * 2)
+ if (size > table.length)
resize(table.length * 2);
int i = h.hashCode() & mask;