summaryrefslogtreecommitdiffstats
path: root/src/test/util/MemoryMonitor.java
blob: 40303833e460dcf638889dba0325b463b3bb9e6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package test.util;

public class MemoryMonitor implements Runnable {

	public static boolean run = false;
	
	
	public void run() {
		
		while(run) {
			try {
				Thread.sleep(500);
			} catch(InterruptedException ex) {
				ex.printStackTrace();
			}
			
			//Runtime.getRuntime().gc();
			System.err.println((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())/(1024*1024));
			
		}
		
	}

	
}