mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Attempt to fix occasional test-failure.
This commit is contained in:
parent
7ed4f94f50
commit
0664dab5c6
1 changed files with 9 additions and 2 deletions
|
@ -5912,9 +5912,16 @@ public class AST2Tests extends AST2BaseTest {
|
|||
}
|
||||
|
||||
private long memoryUsed() throws InterruptedException {
|
||||
System.gc();Thread.sleep(200);System.gc();
|
||||
final Runtime runtime = Runtime.getRuntime();
|
||||
return runtime.totalMemory()-runtime.freeMemory();
|
||||
long mem= runtime.totalMemory()-runtime.freeMemory();
|
||||
long newMem= mem;
|
||||
do {
|
||||
Thread.sleep(50);
|
||||
System.gc();
|
||||
mem= newMem;
|
||||
newMem= runtime.totalMemory()-runtime.freeMemory();
|
||||
} while (newMem < mem);
|
||||
return mem;
|
||||
}
|
||||
|
||||
// int n= 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue