-
Bug
-
Resolution: Fixed
-
P3
-
5.0, 6
-
b06
-
generic, x86
-
generic, linux, windows_2003, windows_xp
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2140967 | 6u2 | Martin Buchholz | P3 | Resolved | Fixed | b01 |
JDK-2143840 | 5.0u12 | Martin Buchholz | P3 | Resolved | Fixed | b01 |
for example, with a timed tryAcquire, continues to consume memory.
------------------------------------
public class Leak6 {
public static void main(String [] args) throws Throwable {
final int n = 1000*1000;
long mem = Runtime.getRuntime().freeMemory();
System.out.println("Free: " + mem);
Semaphore s = new Semaphore(0);
int i = 0;
try {
while (++i < n)
s.tryAcquire(1,TimeUnit.MICROSECONDS);
} catch (OutOfMemoryError oome) {
System.out.printf("OOME on iteration %d%n", i);
}
System.gc();
long mem2 = Runtime.getRuntime().freeMemory();
System.out.println("Memory used: " + (mem2 - mem));
}
}
------------------------------------
==> java -Xmx16m -esa -ea Leak6
Free: 7675240
OOME on iteration 488232
Memory used: 5888064
- backported by
-
JDK-2140967 Synchronizer timed acquire still leaks memory
- Resolved
-
JDK-2143840 Synchronizer timed acquire still leaks memory
- Resolved
- duplicates
-
JDK-6490770 Supposedly fixed memory leak leads to 100% VM CPU usage
- Closed
-
JDK-6500694 Need to backport fix for 6236036 to Java 5 from Java 6
- Closed
-
JDK-6571733 ReentrantReadWriteLock blocks obtaining read lock after write lock times out
- Closed
-
JDK-6539568 Memory leak in AbstractQueuedSynchronizer.cancelAcquire(Node)
- Closed
-
JDK-6491621 Documentation for timeouts cause garbage retention in java.util.concurrent lock
- Closed
- relates to
-
JDK-6236036 Timeouts can cause garbage retention in lock classes
- Resolved
-
JDK-6574123 Help implementers of fair synchronizers
- Resolved
-
JDK-6493287 Unproductive CPU-spinning GCs on heap exhaustion; please throw OOME instead
- Closed
-
JDK-6493335 Mismatch between -Xm[sx] and verbose:gc output
- Closed
-
JDK-2143708 Timeouts can cause garbage retention in lock classes
- Closed