diff --git a/samtools.wdl b/samtools.wdl
index 5bb6d09da2a5ce0484ab776475bdb09e0a7fa2d6..59f5b0eadb9575becb1d783c6e2ddec310fbee68 100644
--- a/samtools.wdl
+++ b/samtools.wdl
@@ -129,6 +129,7 @@ task view {
     Int? excludeFilter
     Int? excludeSpecificFilter
     Int? threads
+    Int? memory
 
     command {
     set -e -o pipefail
@@ -148,4 +149,8 @@ task view {
     output {
         File outputFile = outputFileName
     }
+    runtime {
+        cpu: select_first([threads, 1])
+        memory: select_first([memory, 1])
+    }
 }