IDEMPIERE-6130 Show gc information (#2339)
This commit is contained in:
parent
f82c6a9468
commit
439b158224
|
|
@ -120,9 +120,15 @@ public class AboutWindow extends Window implements EventListener<Event> {
|
||||||
*/
|
*/
|
||||||
private void init() {
|
private void init() {
|
||||||
|
|
||||||
|
Runtime runtime = Runtime.getRuntime();
|
||||||
|
long usedMemoryBefore = runtime.totalMemory() - runtime.freeMemory();
|
||||||
System.runFinalization();
|
System.runFinalization();
|
||||||
System.gc();
|
System.gc();
|
||||||
|
try {Thread.sleep(100);} catch (InterruptedException e) {} // Give some time for GC to complete
|
||||||
|
long usedMemoryAfter = runtime.totalMemory() - runtime.freeMemory();
|
||||||
|
long freedMemory = usedMemoryAfter - usedMemoryBefore;
|
||||||
|
log.warning(String.format("Memory: total %,d, before gc: %,d, after gc %,d, freed by gc %,d bytes%n", runtime.totalMemory(), usedMemoryBefore, usedMemoryAfter, freedMemory));
|
||||||
|
|
||||||
this.setPosition("center");
|
this.setPosition("center");
|
||||||
this.setTitle(ThemeManager.getBrowserTitle());
|
this.setTitle(ThemeManager.getBrowserTitle());
|
||||||
this.setSclass("popup-dialog about-window");
|
this.setSclass("popup-dialog about-window");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue