From c7dbf66d41744cb439b57764510c1a5546ca8902 Mon Sep 17 00:00:00 2001 From: kshakir Date: Thu, 2 Dec 2010 22:38:06 +0000 Subject: [PATCH] Added a javaMemoryLimit option for cases where the java -Xmx memory should be lower than the bsub memory limit. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4778 348d0f76-0448-11de-a6fe-93d51630548a --- .../queue/function/JavaCommandLineFunction.scala | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scala/src/org/broadinstitute/sting/queue/function/JavaCommandLineFunction.scala b/scala/src/org/broadinstitute/sting/queue/function/JavaCommandLineFunction.scala index 740679414..ebac3465c 100644 --- a/scala/src/org/broadinstitute/sting/queue/function/JavaCommandLineFunction.scala +++ b/scala/src/org/broadinstitute/sting/queue/function/JavaCommandLineFunction.scala @@ -9,8 +9,20 @@ trait JavaCommandLineFunction extends CommandLineFunction { */ def javaExecutable: String + /** + * Memory limit for the java executable, or if None will use the default memoryLimit. + */ + var javaMemoryLimit: Option[Int] = None + + override def freezeFieldValues = { + super.freezeFieldValues + + if (javaMemoryLimit.isEmpty && memoryLimit.isDefined) + javaMemoryLimit = memoryLimit + } + def javaOpts = "%s -Djava.io.tmpdir=%s" - .format(optional(" -Xmx", memoryLimit, "g"), jobTempDir) + .format(optional(" -Xmx", javaMemoryLimit, "g"), jobTempDir) def commandLine = "java%s %s" .format(javaOpts, javaExecutable)