From 32c6b481063293b87f99c2530e8d3fbd68ec29cb Mon Sep 17 00:00:00 2001 From: depristo Date: Tue, 31 Aug 2010 20:30:09 +0000 Subject: [PATCH] Proper memory metrics in the file. Please use -et if at all possible git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4175 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/gatk/phonehome/GATKRunReport.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/phonehome/GATKRunReport.java b/java/src/org/broadinstitute/sting/gatk/phonehome/GATKRunReport.java index 19681dc1c..270949137 100644 --- a/java/src/org/broadinstitute/sting/gatk/phonehome/GATKRunReport.java +++ b/java/src/org/broadinstitute/sting/gatk/phonehome/GATKRunReport.java @@ -117,8 +117,11 @@ public class GATKRunReport { @Element(required = true, name = "svn_version") private String svnVersion; - @Element(required = true, name = "memory") - private long memory; + @Element(required = true, name = "total_memory") + private long totalMemory; + + @Element(required = true, name = "max_memory") + private long maxMemory; @Element(required = true, name = "java_tmp_directory") private String tmpDir; @@ -181,10 +184,14 @@ public class GATKRunReport { runTime = (end.getTime() - engine.getStartTime().getTime()) / 1000L; // difference in seconds nIterations = engine.getCumulativeMetrics().getNumIterations(); nReads = engine.getCumulativeMetrics().getNumReadsSeen(); - //readMetrics = engine.getCumulativeMetrics().toString(); - memory = Runtime.getRuntime().totalMemory(); // todo -- expand tmpDir = System.getProperty("java.io.tmpdir"); + // deal with memory usage + Runtime.getRuntime().gc(); // call GC so totalMemory is ~ used memory + maxMemory = Runtime.getRuntime().maxMemory(); + totalMemory = Runtime.getRuntime().totalMemory(); + + // user and hostname -- information about the runner of the GATK userName = System.getProperty("user.name"); hostName = resolveHostname();